Skip to content

Instantly share code, notes, and snippets.

@rayboyd
Created December 28, 2009 19:57
Show Gist options
  • Save rayboyd/264883 to your computer and use it in GitHub Desktop.
Save rayboyd/264883 to your computer and use it in GitHub Desktop.
//
// jQuery Twitter
//
// user
var username = 'rayboyd';
// callback
var callback = 'parseTwitterFeed';
// count
var count = 1;
// target
var target = '.somediv';
// get feed
$.getScript('http://twitter.com/statuses/user_timeline/' + username + '.json?callback=' + callback + '&count=' + count);
// parse feed
function parseTwitterFeed(data) {
var i = 0;
while (i<data.length) {
$('<p></p>').html(data[i].text).appendTo(target);
++i;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment