Update lab1.md

master
Vladimir Protsenko 3 years ago
parent 363a714aec
commit 7d99eec9e3

@ -169,7 +169,7 @@ class MyStreamListener(tweepy.StreamListener):
if status_code == 420: if status_code == 420:
return False return False
def monitoring_samara_tweets(api, query="", locations=None): def monitoring_tweets(api, query="", locations=None):
myStreamListener = MyStreamListener() myStreamListener = MyStreamListener()
myStream = tweepy.Stream( myStream = tweepy.Stream(
auth = api.auth, auth = api.auth,
@ -183,7 +183,7 @@ if __name__ == '__main__':
auth = tweepy.OAuthHandler(API_KEY, API_SECRET) auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
api = tweepy.API(auth) api = tweepy.API(auth)
monitoring_samara_tweets(api, query="", locations=GEOBOX_SAMARA_BIG) monitoring_tweets(api, query="", locations=GEOBOX_SAMARA_BIG)
except Exception as error_msg: except Exception as error_msg:
print (error_msg) print (error_msg)
``` ```

Loading…
Cancel
Save