KakarlaMounika / python-twitter

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

404 - Dependency issue? #247

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I currently have installed simplejson, httplib2, and python-oauth2.
Perhaps I'm missing some other dependency?  I'm new to this, so I'm sorry for 
such a dumb issue.

Code is below:

import sys
import twitter

def main():
  api = twitter.Api()
  statuses = api.GetPublicTimeline()
  print [s.user.name for s in statuses]

What is the expected output? What do you see instead?

It should come back with some status updates, but I get this traceback instead.

Traceback (most recent call last):
  File "new.py", line 14, in <module>
    main()
  File "new.py", line 10, in main
    statuses = api.GetPublicTimeline()
  File "/usr/lib/pymodules/python2.7/twitter.py", line 1319, in GetPublicTimeline
    json = self._FetchUrl(url,  parameters=parameters)
  File "/usr/lib/pymodules/python2.7/twitter.py", line 2030, in _FetchUrl
    url_data = opener.open(url, encoded_post_data).read()
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

What version of the product are you using? On what operating system?

I'm using the last python-twitter on Linux Mint.

Please provide any additional information below.
If I try to authenticate, all of my requests come back as 401.
Thanks for your help!

Original issue reported on code.google.com by AdamWest...@gmail.com on 30 Jan 2013 at 4:26

GoogleCodeExporter commented 8 years ago
if you don't authenticate then it will always return an error. 

I'm going to mark this as closed - if you still have trouble after getting your 
tokens from twitter *and* testing by doing the below, please reopen.

import sys
import twitter

def main():
  api = twitter.Api(consumer_key='your_key',
                       consumer_secret='your_secret',
                       access_token_key='token_key',
                       access_token_secret='token_secret',
                       debugHTTP=True)
  print api.VerifyCredentials()

Original comment by bear42 on 6 Oct 2013 at 10:21