I'm trying to search tweets by geo-location. I'm trying to get tweets in New York using:
twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
geocode = "42.3482° N, 75.1890° W"
search_results = twitter.search_geo(count=10,geocode=geocode)
try:
for tweet in search["statuses"]:
print(tweet ['text'])
it returns an error
Traceback (most recent call last):
File "D:\Projects\M Tools\Twython\My works\new.py", line 18, in <module>
search_results = twitter.search_geo(count=10,geocode=geocode)
File "C:\Python34\lib\site-packages\twython-3.2.0-py3.4.egg\twython\endpoints.py", line 818, in search_geo
return self.get('geo/search', params=params)
File "C:\Python34\lib\site-packages\twython-3.2.0-py3.4.egg\twython\api.py", line 263, in get
return self.request(endpoint, params=params, version=version)
File "C:\Python34\lib\site-packages\twython-3.2.0-py3.4.egg\twython\api.py", line 257, in request
api_call=url)
File "C:\Python34\lib\site-packages\twython-3.2.0-py3.4.egg\twython\api.py", line 198, in _request
retry_after=response.headers.get('X-Rate-Limit-Reset'))
twython.exceptions.TwythonError: Twitter API returned a 400 (Bad Request), You must provide valid coordinates, IP address, query, or attributes.