import os WORKSPACE = '/home/hermes/workspace' # Fixes needed per article: # 1. Remove emojis from BGG h2 headings # 2. Add
after lead paragraph in ALL 6 files_to_fix = [ 'artikel_cmon_status_update_2026.html', 'artikel_renegade_essence20_ende_2026.html', 'artikel_awaken_realms_thundergryph_2026.html', 'artikel_asmodee_moodbox_2026.html', 'artikel_medium_hand_of_fate_2026.html', 'artikel_bgg_best_of_june_2026.html', ] for filename in files_to_fix: filepath = os.path.join(WORKSPACE, filename) with open(filepath, 'r', encoding='utf-8') as f: content = f.read() changes = [] # 1. Fix BGG h2 emojis if filename == 'artikel_bgg_best_of_june_2026.html': emoji_map = { '🏆 20th Annual Golden Geek Awards: Die Gewinner für 2025': '20th Annual Golden Geek Awards: Die Gewinner für 2025', '🔥 BGG Hotness: Die Top 10 im Juni 2026': 'BGG Hotness: Die Top 10 im Juni 2026', '📰 BGG-News & Community-Highlights': 'BGG-News & Community-Highlights', '🎲 Meistgespielte Spiele des Monats': 'Meistgespielte Spiele des Monats', '🔮 Ausblick auf Juli 2026': 'Ausblick auf Juli 2026', } for old, new in emoji_map.items(): if old in content: content = content.replace(f'

{old}

', f'

{new}

') changes.append(f' Emoji entfernt: {old[:50]}') # 2. Add Read-More after first

that follows
# Find the first paragraph after
article_start = content.find('
') if article_start > 0: after_article = content[article_start:] # Find the first

after the dachzeile first_p_end = after_article.find('

') if first_p_end > 0: # Check that read-more doesn't already exist nearby nearby = after_article[:first_p_end + 200] if 'system-readmore' not in nearby: # Insert after that first

insert_pos = article_start + first_p_end + 4 # after

content = (content[:insert_pos] + '\n
\n' + content[insert_pos:]) changes.append(' Read-More eingefügt') with open(filepath, 'w', encoding='utf-8') as f: f.write(content) print(f'{filename}: {"; ".join(changes) if changes else "keine Änderungen"}')