Created
June 14, 2012 13:16
-
-
Save rutger1140/2930242 to your computer and use it in GitHub Desktop.
Simple Twitter search with jQuery
This file contains 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
/* Simple Twitter search */ | |
var hashtag = "#ek2012"; | |
var urlhash = encodeURIComponent(hashtag); | |
var numPosts = 1; | |
var target = $("#tweetwrap"); | |
var ajaxurl = "http://search.twitter.com/search.json?callback=?&q="+urlhash+ "&rpp="+numPosts; | |
$.getJSON( | |
ajaxurl, | |
function (data){ | |
$.each(data.results, function(i,post){ | |
target.append( | |
'<q>'+post.text + '</q>' | |
); | |
}); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment