import os, re

with open('index.html', 'r', encoding='utf-8') as f:
    content = f.read()
    match = re.search(r'<footer class="ul-footer">.*?</footer>', content, re.DOTALL)
    if match:
        new_footer = match.group(0)
    else:
        print('Footer not found in index.html')
        exit(1)

files = [f for f in os.listdir('.') if f.endswith('.html') and f != 'index.html']
for file in files:
    with open(file, 'r', encoding='utf-8') as f:
        file_content = f.read()
    if '<footer class="ul-footer">' in file_content:
        updated_content = re.sub(r'<footer class="ul-footer">.*?</footer>', new_footer, file_content, flags=re.DOTALL)
        with open(file, 'w', encoding='utf-8') as f:
            f.write(updated_content)
        print(f'Updated footer in {file}')

