How do I convert a Twitter User ID to a Twitter Username

Posted by codyvbrown on Stack Overflow See other posts from Stack Overflow or by codyvbrown
Published on 2010-05-19T18:58:58Z Indexed on 2010/05/19 19:00 UTC
Read the original article Hit count: 178

Filed under:

Hi I'm building an app in rails that needs to convert a twitter id into the twitter username. This is the code that pulls the id.

url = 'http://twitter.com/' + params[:username] buffer = open(url, 'UserAgent' => 'irb').read @vouched_user_twitter_id = buffer[/\d+(?=.rss)/]

How do I use that number to pull the username once i no longer have params.

Thanks!

© Stack Overflow or respective owner

Related posts about ruby-on-rails