Skip to content

Instantly share code, notes, and snippets.

@jacqui
Created July 13, 2010 19:37
Show Gist options
  • Select an option

  • Save jacqui/474385 to your computer and use it in GitHub Desktop.

Select an option

Save jacqui/474385 to your computer and use it in GitHub Desktop.
def users(*ids_or_usernames)
ids, usernames = [], []
ids_or_usernames.each do |id_or_username|
if id_or_username.is_a?(Integer)
ids << id_or_username
elsif id_or_username.is_a?(String)
usernames << id_or_username
end
end
query = {}
query[:user_id] = ids.join(",") unless ids.empty?
query[:screen_name] = usernames.join(",") unless usernames.empty?
perform_get("/users/lookup.json", :query => query)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment