bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 956 forks source link

id_str is always None (value from request is not assigned) #231

Closed steckerhalter closed 8 years ago

steckerhalter commented 9 years ago

see https://github.com/bear/python-twitter/blob/master/twitter/status.py#L533

jonathan-s commented 9 years ago

Perhaps we shall remove id_str entirely. I mean we have the id as a number, seems a bit redundant having the id a string then.

ryankicks commented 9 years ago

Sorry for jumping in randomly, but I believe they're not always guaranteed to be the same. Does this help?

https://dev.twitter.com/overview/api/twitter-ids-json-and-snowflake

jonathan-s commented 9 years ago

Not at all, it was a welcome contribution. So in essence, if you're coding in javascript, id can be problematic. And as far as I know the Json decoder in python won't throw an exception.

  1. If you develop in Javascript, know that you will have to update your code to read the string version instead of the integer version.
  2. If you use a JSON decoder, validate that the example JSON, above, decodes without throwing exceptions. If exceptions are thrown, you will need to pre-parse the data. Please let us know the name, version, and language of the parser which throws the exception so we can investigate.

Jonathan Sundqvist Twitter http://www.twitter.com/ecologythinking | Linkedin http://se.linkedin.com/in/jonathansundqvist | Support me http://bit.ly/gittipJS

On Mon, May 18, 2015 at 10:49 PM, Ryan Choi notifications@github.com wrote:

Sorry for jumping in randomly, but I believe they're not always guaranteed to be the same. Does this help?

https://dev.twitter.com/overview/api/twitter-ids-json-and-snowflake

— Reply to this email directly or view it on GitHub https://github.com/bear/python-twitter/issues/231#issuecomment-103223548 .

steckerhalter commented 9 years ago

As for my part I wrote a small API with python-twitter and wanted to use the id in JS and found that it parses a wrong number hence I tried to switch to id_str which was always None...

jonathan-s commented 9 years ago

Alright then :). Let's try to fix this :)

On Tuesday, May 19, 2015, steckerhalter notifications@github.com wrote:

As for my part I wrote a small API with python-twitter and wanted to use the id in JS and found that it parses a wrong number hence I tried to switch to id_str which was always None...

— Reply to this email directly or view it on GitHub https://github.com/bear/python-twitter/issues/231#issuecomment-103398567 .

Sent from Gmail Mobile

jeremylow commented 8 years ago

Fixed in PR #312