Skip to content

Instantly share code, notes, and snippets.

@AVGP
Created September 19, 2010 14:56
Show Gist options
  • Save AVGP/586819 to your computer and use it in GitHub Desktop.
Save AVGP/586819 to your computer and use it in GitHub Desktop.
<style>
body
{
min-width:300px;
overflow-x:hidden;
}
p
{
border:#ddd thin solid;
background-color:#eee;
margin:2px;
left:20px;
width:280px;
}
</style>
<h2>The global timeline:</h2>
<script>
var req = new XMLHttpRequest();
req.open(
"GET",
"http://api.twitter.com/1/statuses/public_timeline.json",
true);
req.onload = doopdeedoop;
req.send(null);
function doopdeedoop()
{
var json = eval(req.responseText);
for(i=0;i<json.length;i++)
{
var param = document.createElement("p");
param.innerHTML = json[i].text;
document.body.appendChild(param);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment