From 7d8fcc5fb9b1fe8293f30200deb0254c22af5b7d Mon Sep 17 00:00:00 2001 From: leandrotoledo Date: Tue, 14 Jul 2015 04:31:20 -0300 Subject: [PATCH] update examples --- examples/echobot.py | 4 ++-- examples/roboed.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/echobot.py b/examples/echobot.py index fc386982a..edc2a2e8a 100644 --- a/examples/echobot.py +++ b/examples/echobot.py @@ -6,7 +6,7 @@ import telegram import time # Telegram Bot Authorization Token -bot = telegram.Bot('token') +bot = telegram.Bot('TOKEN') # This will be our global variable to keep the latest update_id when requesting # for updates. It starts with the latest update_id available. @@ -35,4 +35,4 @@ def echo(): if __name__ == '__main__': while True: echo() - time.sleep(5) + time.sleep(3) diff --git a/examples/roboed.py b/examples/roboed.py index a1812402d..f1c0b044f 100644 --- a/examples/roboed.py +++ b/examples/roboed.py @@ -6,11 +6,11 @@ __author__ = 'leandrotoledodesouza@gmail.com' import telegram -import requests +import urllib def main(): - bot = telegram.Bot('token') # Telegram Bot Authorization Token + bot = telegram.Bot('TOKEN') # Telegram Bot Authorization Token global LAST_UPDATE_ID LAST_UPDATE_ID = bot.getUpdates()[-1].update_id # Get lastest update @@ -31,7 +31,7 @@ def main(): def ed(text): url = 'http://www.ed.conpet.gov.br/mod_perl/bot_gateway.cgi?server=0.0.0.0%3A8085&charset_post=utf-8&charset=utf-8&pure=1&js=0&tst=1&msg=' + text - data = requests.get(url).content + data = urllib.urlopen(url).read() return data.strip()