How to get users info with an array of id when some of the ids don't exist anymore ?
9 views
Skip to first unread message
Stéphan Dufour
unread,
Dec 28, 2017, 12:33:25 PM12/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Twitter Ruby Gem
Hi,
I have a list of old twitter ids and I want to quickly retrieve user info from user_array = client.users(ids, options={"count" => 100})
The problem is: some of the ids don't exist anymore. When the first unknown id is reached, a NotFound error is raised and the method fails.
I know I could rewrite my code to request each id individually but it seems awfully unefficient.
Is there a way to handle the exception so as the request returns all existing ids ? Could there be a parameter I could set so as to have a nil object when the user is not found ?