Skip to content

Instantly share code, notes, and snippets.

@WillisN
Last active Sep 29, 2020
Embed
What would you like to do?
code
def get_tweets():
url = 'https://stream.twitter.com/1.1/statuses/filter.json'
query_data = [('language', 'en'), ('locations', '-130,-20,100,50')]
query_url = url + '?' + '&'.join([str(t[0]) + '=' + str(t[1]) for t in query_data])
response = requests.get(query_url, auth=my_auth, stream=True)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment