开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜