I’m currently working a project that involves working with the Twitter API. The public Twitter API is pretty straight-forward to use, but after working with the OAuth API for the past few days, I was ready to tear my hair out! Luckily, I was able to get a more experienced developer friend to help me get the GET users/lookup Twitter REST API call to work (although it took him a few hours to figure this out as well). Here is how he did it:

We started out by trying out all the available Twitter OAuth ruby gems, and by far, the best one we found was the twitter_oauth gem. Unfortunately, this gem is missing the GET users / lookup call.

So, we used the available code in this gem to modify it to include the GET users / lookup call. We modified the Client class to the following: