Skip to content

Instantly share code, notes, and snippets.

@me-suzy
me-suzy / gist:02cbf992dabd47b58e16bb29f418cb49
Created June 22, 2023 06:58
Python sending email Cpanel smtp
#!/usr/bin/python
import sys
import smtplib
from_addr = '[email protected]'
to_addrs = ['[email protected]']
msg = """From: Sender
To: Recipient
Subject: This is the message subject
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head>
<!-- NAME: 1 COLUMN -->
<!--[if gte mso 15]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
import urllib.request
import re
from bs4 import BeautifulSoup
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# Accesează index.html
url = r"file:///e:/Carte/BB/17%20-%20Site%20Leadership/Principal%202022/ro/index.html"
<!-- $item_id = 1; // Replace that with your rating id -->
<!DOCTYPE html>
<html lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<title>11 metri patrati | Neculai Fantanaru</title>
<link rel="icon" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" sizes="192x192" />
<link rel="apple-touch-icon-precomposed" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" />
<meta name="msapplication-TileImage" content="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" />
<link rel="icon" type="image/x-icon" href="https://neculaifantanaru.com/totul_despre_lideri_si_leadership.ico" />
<!-- $item_id = 819; // Replace that with your rating id -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<title>Acei copii ai soaptei timpului | Neculai Fantanaru</title>
<!-- $item_id = 5224; // Replace that with your rating id -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<title>Protect Your Company's Image | Neculai Fantanaru (en)</title>
import re
import os
from bs4 import BeautifulSoup
from bs4.formatter import HTMLFormatter
from googletrans import Translator
import requests
translator = Translator()
class UnsortedAttributes(HTMLFormatter):
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Castel
#
# Created: 22/01/2022
# Copyright: (c) Castel 2022
# Licence: <your licence>
#-------------------------------------------------------------------------------
@me-suzy
me-suzy / gist:9bb3b344c38b4dab53c6db74c78f9695
Created July 5, 2023 06:34
ChatGPT - BUN FINAL 17 aprilie
import os
import regex
# Define the FOLDER_LOCAL with your HTML files
FOLDER_LOCAL = r'd:\Folder1\fisiere_html\de-convertit\1'
# Define the regex pattern
meta_pattern = regex.compile(r'<meta content="((?:(?!<meta).)*?)"\sname="description"\s/>', regex.DOTALL)
# Initialize list to keep track of modified files
import time
import urllib.request
import re
from subprocess import run
# Calea către fisierul index.html
index_file_path = r"file:///e:/Carte/BB/17%20-%20Site%20Leadership/Principal%202022/ro/index.html"
# index_file_path = "https://www.neculaifantanaru.com/index.html"