开发者

How can I get a Twitter screenname/username with the twitter_oauth gem using their id?

开发者 https://www.devze.com 2023-02-06 10:23 出处:网络
How can I get a Twitter screenname/username with th开发者_开发百科e twitter_oauth gem using their id?Here you go, a sample in irb:

How can I get a Twitter screenname/username with th开发者_开发百科e twitter_oauth gem using their id?


Here you go, a sample in irb:

require 'rubygems'
require 'twitter_oauth'
client = TwitterOAuth::Client.new
id = '5452272'  
temp = client.show(id)
puts "Screenname: #{temp['screen_name']}, UserName: #{temp['name']}"
0

精彩评论

暂无评论...
验证码 换一张
取 消