-
-
Save makenosound/1046087 to your computer and use it in GitHub Desktop.
bare bones method for grabbing and updating a users latest tweet (with no error handling whatsoever)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=someonesplendid', | |
dataType: 'jsonp', | |
success: function(data) { | |
var tweet = data[0].text; | |
tweet = tweet.replace(/(http\:\/\/[A-Za-z0-9\.\/_]+)/g, '<a href="$1">$1</a>'); | |
tweet = tweet.replace(/@([a-zA-Z0-9_]+)/g, '<a href="http://twitter.com/$1">@$1</a>'); | |
$('#tweet').html(tweet); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment