Skip to content

Instantly share code, notes, and snippets.

@WillisN
Last active September 29, 2020 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillisN/21aec016519efbd420177073fcb3605c to your computer and use it in GitHub Desktop.
Save WillisN/21aec016519efbd420177073fcb3605c to your computer and use it in GitHub Desktop.
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