Created
September 19, 2010 14:56
-
-
Save AVGP/586819 to your computer and use it in GitHub Desktop.
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
<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