danielpronych / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

Python-twitter doesn't work. Please? #178

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Trying to use it.
2. I use Kubuntu and Windows. None works.
3. s = api.GetPublicTimeline("enryh") doesn't work
4. login doesn't work
5. s = api.GetPublicTimeline() works

henry@henry-laptop:~$ sudo easy_install simplejson
Searching for simplejson
Reading http://pypi.python.org/simple/simplejson/
Reading http://undefined.org/python/#simplejson
Best match: simplejson 2.1.2
Downloading 
http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.2.tar.gz#md5=
a856f9ae9ab3749991a93ddeafadc554
Processing simplejson-2.1.2.tar.gz
Running simplejson-2.1.2/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-gc_O40/simplejson-2.1.2/egg-dist-tmp-DmDx2H
Adding simplejson 2.1.2 to easy-install.pth file

Installed 
/usr/local/lib/python2.6/dist-packages/simplejson-2.1.2-py2.6-linux-i686.egg
Processing dependencies for simplejson
Finished processing dependencies for simplejson
henry@henry-laptop:~$ sudo easy_install httplib2
Searching for httplib2
Reading http://pypi.python.org/simple/httplib2/
Reading http://code.google.com/p/httplib2/
Reading http://bitworking.org/projects/httplib2/
Best match: httplib2 0.6.0
Downloading http://httplib2.googlecode.com/files/httplib2-0.6.0.zip
Processing httplib2-0.6.0.zip
Running httplib2-0.6.0/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-4BLtUb/httplib2-0.6.0/egg-dist-tmp-C8HGRI
zip_safe flag not set; analyzing archive contents...
Adding httplib2 0.6.0 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/httplib2-0.6.0-py2.6.egg
Processing dependencies for httplib2
Finished processing dependencies for httplib2
henry@henry-laptop:~$ sudo easy_install ouath2
Searching for ouath2
Reading http://pypi.python.org/simple/ouath2/
Couldn't find index page for 'ouath2' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for ouath2
error: Could not find suitable distribution for Requirement.parse('ouath2')
henry@henry-laptop:~$ sudo easy_install oauth2
Searching for oauth2
Reading http://pypi.python.org/simple/oauth2/
Reading http://github.com/simplegeo/python-oauth2
Best match: oauth2 1.2.0
Downloading 
http://pypi.python.org/packages/source/o/oauth2/oauth2-1.2.0.tar.gz#md5=42b41a74
632ccceb6094b5c232f3efec
Processing oauth2-1.2.0.tar.gz
Running oauth2-1.2.0/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-GYgA7u/oauth2-1.2.0/egg-dist-tmp-bw8xIp
Adding oauth2 1.2.0 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/oauth2-1.2.0-py2.6.egg
Processing dependencies for oauth2
Finished processing dependencies for oauth2

henry@henry-laptop:~$ sudo easy_install python-twitter
Searching for python-twitter
Reading http://pypi.python.org/simple/python-twitter/
Reading http://code.google.com/p/python-twitter/
Best match: python-twitter 0.6
Downloading http://python-twitter.googlecode.com/files/python-twitter-0.6.tar.gz
Processing python-twitter-0.6.tar.gz
Running python-twitter-0.6/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-byZL4p/python-twitter-0.6/egg-dist-tmp-nBBdez
zip_safe flag not set; analyzing archive contents...
Adding python-twitter 0.6 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/python_twitter-0.6-py2.6.egg
Processing dependencies for python-twitter
Finished processing dependencies for python-twitter

henry@henry-laptop:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import twitter
>>> api = twitter.Api()
>>> s = api.GetPublicTimeline("enryh")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/twitter.py", line 1319, in GetPublicTimeline
    json = self._FetchUrl(url,  parameters=parameters)
  File "/usr/lib/pymodules/python2.6/twitter.py", line 2030, in _FetchUrl
    url_data = opener.open(url, encoded_post_data).read()
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

Original issue reported on code.google.com by henry...@gmail.com on 27 Nov 2010 at 2:53

GoogleCodeExporter commented 8 years ago
This error is occurring because python-twitter relies on Basic-Auth which 
Twitter switched off sometime between August and September (2010). Only OAuth 
is supported by the API, and python-twitter doesn't support this.

You may want to use Mike Verdone's library instead:

http://mike.verdone.ca/twitter/

Original comment by chri...@gmail.com on 2 Dec 2010 at 11:52

GoogleCodeExporter commented 8 years ago
python-twitter DOES support OAuth, like I mentioned in Issue 177 - if you are 
going to refer to other libs please be accurate

Original comment by bear42 on 8 Dec 2010 at 1:01