gfcapalbo / python-twitter

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

Expose the in_reply_to_status_id and in_reply_to_user_id attributes for a status #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm writing a small twitter mashup and needed access to the in_reply
attributes for a status.  I modified the twitter.py file to expose the
attributes.  Am submitting my code changes here as a patch file and with
the entire modified twitter.py as twitter.py.r118.01.

What changes did I implement?
I exposed two attributes for the status object that were not being exposed.
in_reply_to_status_id and in_reply_to_user_id
No additional methods or functions were created on these attributes.

What version of the product are you using? On what operating system?
r118 on Ubuntu 7.10

Usage:
api=twitter.Api()
timeline=api.GetPublicTimeline()
print timeline[0].in_reply_to_status_id

If the status is not a reply, then in_reply_to_status_id will be None .
If you retrieve a status based on the in_reply_to_status_id, and the status
is protected or private, an HTTPError 403 Forbidden will be returned. This
can be trapped via IOError like this:

try:
  tempstatus=api.GetStatus(timeline[0].in_reply_to_status_id)
except IOError, e:
  print 'IOError',e,'was returned'

Last Bit of Info:
I am a novice to Python (and programming) so please double check my code
and correct where appropriate. Clinton: Thanks so much for a great Api that
is so easy to work with, even for a novice like myself.

Original issue reported on code.google.com by hanitain...@gmail.com on 12 Jul 2008 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dclinton on 14 Jul 2008 at 1:54

GoogleCodeExporter commented 9 years ago
Fixed in trunk in r123 
(http://code.google.com/p/python-twitter/source/detail?r=123).
Please verify.

Original comment by dclinton on 21 Feb 2009 at 5:18