Custom Twitter Feeds
More and more sites are asking to include their social feeds on their site, but rarely do they want the ‘classic’ feed look that comes from each site. Usually the designer has come up with a way that fits with the overall look of the site while throwing out the ‘classic’ look. Honestly, I don’t blame them. So how can we combine the designer’s view with the functionality?
When I first went to tackle this, I found more than few methods for getting this to work. Many of them required setting up OAuth to communicate back and forth or cluttered me with so many options it was hard to just boil it down to the basic feeds themselves. Luckily I was able to find the starting block.
http://api.twitter.com/1/statuses/user_timeline.json?screen_name=[twittername]
The above line was my savor to cut through all the complex options that were available. That simple line, when a proper screen name is provided, will give you a JSON object of the most recent posts to that user. This requires no authorization check or permissions to check. If they are set to protected, you won’t see the entries, but usually a business will want anyone and everyone to see the feed. This means no submitting a tweet via the site or any rating directly onto the account in question, but usually we’re just looking to pull the feed to the site, not the other way around.
You can specify a variety of options to help you narrow down your search as found on the dev Twitter page for statuses/user_timeline. I highly encourage you to look them over as it can help you get only the needed information to keep your calls small.
This api can return other formats as well. XML, RSS, and ATOM are also available besides JSON. I find JSON to be a bit easier to use since JS reads it with no extra requirements and other back end codes have libraries that will allow you to move through it. Each format will return far more information that you’ll need, but each format makes pulling only your needed information easy.
Hopefully this helps you get a good start at pulling in your next twitter feed for your next site. This of course is not the only way you can setup twitter, but it’s a quick and easy way of just getting to the information without a lot of overhead.

Comments
Be the first to comment!
Leave A Comment