ckoepp / TwitterSearch

A Python library to easily iterate tweets found by the Twitter Search API
MIT License
387 stars 112 forks source link

tso.setGeocode invalid unit error in TwitterSearchorder.py for UK coordinates #14

Closed ghost closed 11 years ago

ghost commented 11 years ago

I am trying to constrain the area I search for tweets in the UK, but am receiving an error response from the TwitterSearchOrder.py module.

[code]C:\Users\cjadmin>C:\Users\cjadmin\Desktop\py\search.py Traceback (most recent call last): File "C:\Users\cjadmin\Desktop\py\search.py", line 26, in tso.setGeocode(53.409144,-2.147483,10,'mi') # Set location constraints with geocode File "C:\Python27\lib\site-packages\twittersearch-0.78.3-py2.7.egg\TwitterSear ch\TwitterSearchOrder.py", line 138, in setGeocode raise TwitterSearchException(1005) TwitterSearch.TwitterSearchException.TwitterSearchException: Error 1005: Invalid unit.[/code]

I've tried escaping the minus for the geocode but that also fails.

Are UK codes unsupported?

ckoepp commented 11 years ago

There is a not updated line in the documentation which lead to your exception.

It is not "km" or "mi" but km=True for metric or km=False for imperial measurements.

I will fix this in the documentation within the next days. Thanks for your issue!