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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Simple Bot to reply to Telegram messages | |
# This program is dedicated to the public domain under the CC0 license. | |
""" | |
This Bot uses the Updater class to handle the bot. | |
First, a few handler functions are defined. Then, those functions are passed to | |
the Dispatcher and registered at their respective places. |
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
from bs4 import BeautifulSoup | |
from contextlib import contextmanager | |
__current_soup=[] | |
@contextmanager | |
def append(name): | |
node = __current_soup[0].new_tag(name) | |
__current_soup.append(node) | |
global s | |
s = __current_soup[-1] | |
yield node |