Skip to content

Instantly share code, notes, and snippets.

@me-suzy
me-suzy / 4565gfgghhhh.py
Created September 3, 2025 10:43
4565gfgghhhh.py
import os
import regex
def remove_quotes_from_meta_tags(html_content):
# Pattern pentru <meta name="description" content="...">
pattern1 = regex.compile(r'(<meta name="description" content=")(.*?)(">)', regex.DOTALL)
# Pattern pentru <meta property="og:description" content="...">
pattern2 = regex.compile(r'(<meta property="og:description" content=")(.*?)(">)', regex.DOTALL)
@me-suzy
me-suzy / sterge ghilimelele 2.py
Created September 3, 2025 10:41
sterge ghilimelele 2
import os
import regex
def remove_quotes_from_meta_tags(html_content):
# Pattern pentru <meta name="description" content="...">
pattern1 = regex.compile(r'(<meta name="description" content=")(.*?)(">)', regex.DOTALL)
# Pattern pentru <meta property="og:description" content="...">
pattern2 = regex.compile(r'(<meta property="og:description" content=")(.*?)(">)', regex.DOTALL)
@me-suzy
me-suzy / replace oujs.py
Created September 3, 2025 10:00
replace oujs.py
import re
import os
def replace_headers_in_html(file_path):
# Read the content of the HTML file
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# Store original content for comparison
original_content = content
@me-suzy
me-suzy / Find and replace 234.py
Created September 3, 2025 09:29
Find and replace 234.py
import re
import os
def replace_headers_in_html(file_path):
# Read the content of the HTML file
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# Store original content for comparison
original_content = content
@me-suzy
me-suzy / categorii minimal.py
Created September 2, 2025 20:38
categorii minimal.py
import os
import requests
from bs4 import BeautifulSoup, Comment
import time
def get_image_from_local_file(file_path):
"""Extrage imaginea din fișierul HTML local"""
try:
if not os.path.exists(file_path):
return None, None
@me-suzy
me-suzy / categorii final.py
Created September 2, 2025 20:37
categorii final.py
import os
import requests
from bs4 import BeautifulSoup, Comment
import time
def get_image_from_article_page(url):
"""Extrage imaginea din pagina individuală"""
try:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
@me-suzy
me-suzy / adauga imagini categorii 1.py
Created September 2, 2025 17:13
adauga imagini categorii 1
import os
import requests
from bs4 import BeautifulSoup, Comment
import time
import re
def get_image_from_article_page(url):
"""Extrage imaginea din pagina individuală a articolului"""
try:
headers = {
@me-suzy
me-suzy / arata doar categorii.py
Created September 2, 2025 16:07
arata doar categorii
import json
json_data = [
{
"html_file": "lideri-si-atitudine.html",
"line_count": 37,
"title_links": 37,
"read_more_links": 37,
"repeated_links": {}
},
@me-suzy
me-suzy / Varianta Blog 2.html
Last active September 2, 2025 16:03
Varianta Blog 2.html
Ai dreptate, se duplică conținutul. Iată soluția corectă - să ascund complet secțiunea desktop pe mobil:
## HTML simplificat:
```html
<article class="blog-box heading-space-half">
<div class="blog-listing-inner news_item">
<div class="article-card-new">
<!-- Layout DESKTOP - ascuns pe mobil -->
@me-suzy
me-suzy / search.py
Created September 2, 2025 07:37
search.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script sends the given command-line arguments as a query to the running
DocFetcher instance. The results returned by the latter are printed as filename-
filepath pairs on the standard output.
For more advanced processing of the results, call the search function below
directly. In principle, you can also reuse the code in the search function for