Created
September 4, 2025 15:46
-
-
Save me-suzy/6daff0a820ce99d600f94ff1b85a1956 to your computer and use it in GitHub Desktop.
6dfhe54.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def test_one_file(): | |
"""Test pe un singur fișier să văd exact ce se întâmplă""" | |
# Testez fișierul pe care l-ai menționat | |
test_file = r'e:\Carte\BB\17 - Site Leadership\Principal 2022\ro\ochii-vad-lumea-inima-o-simte-pana-in-adanc.html' | |
if not os.path.exists(test_file): | |
print(f"Fișierul nu există: {test_file}") | |
return | |
with open(test_file, 'r', encoding='utf-8') as f: | |
content = f.read() | |
print("CONȚINUT ACTUAL:") | |
print("="*50) | |
# Găsește canonical | |
canonical_match = re.search(r'<link\s+rel="canonical"\s+href="([^"]+)"\s*/?>', content, re.IGNORECASE) | |
if canonical_match: | |
print(f"Canonical găsit: {canonical_match.group(1)}") | |
else: | |
print("Canonical NU găsit!") | |
# Găsește FLAGS section | |
flags_match = re.search(r'<!-- FLAGS_1 -->(.*?)<!-- FLAGS -->', content, re.DOTALL) | |
if flags_match: | |
flags_content = flags_match.group(1) | |
print("\nFLAGS section găsită!") | |
# Găsește link RO | |
ro_match = re.search(r'<li><a cunt_code="\+40" href="https://neculaifantanaru\.com/([^"]+)"', flags_content) | |
if ro_match: | |
print(f"Link RO în FLAGS: {ro_match.group(1)}") | |
else: | |
print("Link RO NU găsit în FLAGS!") | |
# Găsește link EN | |
en_match = re.search(r'<li><a cunt_code="\+1" href="https://neculaifantanaru\.com/en/([^"]+)"', flags_content) | |
if en_match: | |
print(f"Link EN în FLAGS: {en_match.group(1)}") | |
else: | |
print("Link EN NU găsit în FLAGS!") | |
else: | |
print("FLAGS section NU găsită!") | |
print("\nCe AR TREBUI să fie:") | |
print("="*50) | |
filename = os.path.basename(test_file) | |
print(f"Canonical ar trebui: https://neculaifantanaru.com/{filename}") | |
print(f"Link RO în FLAGS ar trebui: {filename}") | |
if __name__ == "__main__": | |
test_one_file() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment