Skip to content

Instantly share code, notes, and snippets.

@megantaylor
Forked from kjam/twitter_example.html
Created September 30, 2011 19:13
Show Gist options
  • Save megantaylor/1254702 to your computer and use it in GitHub Desktop.
Save megantaylor/1254702 to your computer and use it in GitHub Desktop.
Twitter Search
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON('http://search.twitter.com/search.json?q=earthquake&callback=?', function(data) {
var data = data.results;
var html = "<ul>";
for(var i=0; i<data.length; i++) {
html += "<li><a href='http://twitter.com/" + data[i].from_user + "'>@" + data[i].from_user + "</a>: " + data[i].text + "</li>";
}
html += "</ul>"
$('.content').html(html);
});
});
</script>
</head>
<body>
<h2>Twitter</h2>
<div class="content">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment