views:

155

answers:

2

Hi,

I am looking for a way to get a twitter users userid via their username. For example take http://twitter.com/AlySSa_miLAno (yes I know her twitter page off by heart lol) on the right hand side of the page is a link to her RSS feed: feed://twitter.com/statuses/user_timeline/26642006.rss

In this context Alyssa's userid would be 26642006.

Ideally I would like to avoid reading the full content of the page, as this could be quite expensive on a mobile device, so if anyone knows how to accomplish this using any Twitter/3rd party webservices that would be great.

+1  A: 

You can use a library such as: MGTwitterEngine. Then read up on the Twitter API for what attributes you want to use.

christo16
+1  A: 

You can do a GET request for the users profile information. If you use JSON it will be lightweight and should be pretty easy for a mobile application.

The method you want is users/show/:screen_name.json so the final URL will look like this:

http://api.twitter.com/users/show/AlySSa_miLAno.json

You can read more about users/show at http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-users%C2%A0show

abraham