Skip to content

Instantly share code, notes, and snippets.

@technohippy
Created December 8, 2009 08:13
Show Gist options
  • Save technohippy/251514 to your computer and use it in GitHub Desktop.
Save technohippy/251514 to your computer and use it in GitHub Desktop.
<?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