Spaces:
Paused
Paused
Download Telegram_Job_Bot/inject.py from telegramjobupload/README: direct link, hf CLI and curl.
- Browser
- Download file 430 Bytes
-
https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/inject.py
- Command line
-
hf download hf://spaces/telegramjobupload/README/Telegram_Job_Bot/inject.py
-
curl -L -o inject.py https://huggingface.co/spaces/telegramjobupload/README/resolve/main/Telegram_Job_Bot/inject.py
430 Bytes
| import re | |
| with open('main.py', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| with open('top5_v3.html', 'r', encoding='utf-8') as f: | |
| new_html = f.read() | |
| pattern = re.compile(r' return f\"\"\"<!DOCTYPE html>.*?</html>\"\"\"', re.DOTALL) | |
| new_content = pattern.sub(' return f\"\"\"' + new_html + '\"\"\"', content) | |
| with open('main.py', 'w', encoding='utf-8') as f: | |
| f.write(new_content) | |
| print("Replaced!") | |