Created
December 8, 2009 08:13
-
-
Save technohippy/251514 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<Module> | |
<ModulePrefs title="My Second Gadget" height="500" /> | |
<Content> | |
<![CDATA[ | |
<div id="results" /> | |
<style> | |
div.tweet { | |
list-style-type: none; | |
border: 1px green solid; | |
-moz-border-radius: 10px; | |
-webkit-border-radius: 10px; | |
border-radius: 10px; | |
} | |
</style> | |
<script> | |
var searchUrl = 'http://search.twitter.com/search.json?'; | |
var div = document.getElementById('results'); | |
function showResults(response) { | |
var json = gadgets.json.parse(response.data); | |
div.innerHTML = ''; | |
for (var i = 0; i < json.results.length; i++) { | |
div.innerHTML += '<div style="tweet">' + json.results[i].text + '</div>'; | |
} | |
window.setTimeout(searchTwitter, 5 * 60 * 1000); | |
} | |
function searchTwitter() { | |
var params = {q:'google wave', rpp:5}; | |
var url = searchUrl + gadgets.io.encodeValues(params); | |
gadgets.io.makeRequest(url, showResults); | |
} | |
gadgets.util.registerOnLoadHandler(searchTwitter); | |
</script> | |
]]> | |
</Content> | |
</Module> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment