|
@ -26,11 +26,11 @@ def send_coding_love_gif(bot, update): |
|
|
bot.send_animation(chat_id=update.message.chat_id, animation=gif_url, caption=caption) |
|
|
bot.send_animation(chat_id=update.message.chat_id, animation=gif_url, caption=caption) |
|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
|
update.message.reply_text("Error fetching image: %s ¯\_(ツ)_/¯" % random_url) |
|
|
|
|
|
|
|
|
update.message.reply_text("Error fetching image: {} ¯\_(ツ)_/¯".format(random_url)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def send_wiki_how_article(bot, update): |
|
|
def send_wiki_how_article(bot, update): |
|
|
random_howto = requests.get(urls["wikihow"]) |
|
|
random_howto = requests.get(urls["wikihow"]) |
|
|
howto_title = re.search('<title>(.*)</title>', random_howto.text).group(1) |
|
|
howto_title = re.search('<title>(.*)</title>', random_howto.text).group(1) |
|
|
howto_url = re.search('<link rel="canonical" href="(.*)" />', random_howto.text).group(1) |
|
|
|
|
|
|
|
|
howto_url = re.search('<link rel="canonical" href="(.*)".*/>', random_howto.text).group(1) |
|
|
update.message.reply_text(howto_title + "\n" + howto_url) |
|
|
update.message.reply_text(howto_title + "\n" + howto_url) |