How to get users info with an array of id when some of the ids don't exist anymore ?

5 views
Skip to first unread message

Stéphan Dufour

unread,
Dec 28, 2017, 12:33:25 PM12/28/17
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 ?

Stéphan
Reply all
Reply to author
Forward
0 new messages