0

I'm new to Ruby and I'm using sferik gem to get user id matching a search query (first result). The ultimate goal is to get users id matching with a column from a json file

I've read the documentation but don't know really how start... any help will be appreciated.

handac
  • 13
  • 1
  • 6

1 Answers1

0

The sferik gem is just a wrapper around Twitter's REST API, so any responses you get will conform to their contract. If you search for tweets, you'll get Tweet Objects.

Taking an example from sferik, doing a search a getting the user_id for the first result:

# for the User ID (get it as string if you want to use it later in JSON)
client.search("to:justinbieber marry me", result_type: "recent").first.user.id_str

# for the User Screen name
client.search("to:justinbieber marry me", result_type: "recent").first.user.screen_name
elyalvarado
  • 1,226
  • 8
  • 13