Open stronghandsdeeppockets opened 6 years ago
I'm pretty sure this is the problem https://developer.twitter.com/en/docs/basics/twitter-ids
JavaScript cant handle properly the ids because the unsigned 64-bit integers and the ids are becoming invalid at the parser of the library. The library must return the ids on strings instead of numbers.
I found the solution and now all the ids i'm receiving are working. You must add the parameter: stringify_ids : true to the call.
Like this: T.get('followers/ids', { screen_name: 'aisaifu', cursor: cursor, stringify_ids : true }, function (err, data, response) { ...
@stronghandsdeeppockets
@diego1199 Thank you very much for the fix. Can you recommend a mass id converter? Or do I have to use the API again?
You may want to use the users/lookup of the API. That method allows you to send a request of up to 100 ids or screen_names and it will return the full user objects.
@stronghandsdeeppockets: what would you like to convert?
BTW we've documented this gotcha with IDs in our twitter-lite library.
First of all, excuse my rough language, programming isn't quite my strongest point.
I managed, with some external help, to create a js script that fetches the followers of a certain user. However, some users' ids are completely wrong (and by "some", I mean almost half).
A Twitter id must have 8,9 or 10 characters, but some of mine have almost double:
You may notice that the invalid ids all have 18 chars and they always end up "00". All the other ids are accurate.
This is the code:
The code breaks the 5,000 barrier imposed (something about cursors) and it manages to pull 30k ids. The code also is supposed to put each id on a separate line. I took a sample of 1,000 ids from the 30,000 and tested how many were valid. Only 208 are.
Both me and my friend are clueless about what it could cause this issue.