Created
December 2, 2009 07:54
-
-
Save kawahara/247032 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="hello world example"> | |
<Require feature="opensocial-0.8"/> | |
</ModulePrefs> | |
<Content type="html"><![CDATA[ | |
<script type="text/javascript"> | |
function getHtml() { | |
var params = {}; | |
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT; | |
var url = "http://www.google.com"; | |
gadgets.io.makeRequest(url, response, params); | |
}; | |
function response(obj) { | |
//obj.text contains the text of the page that was requested | |
var str = obj.text; | |
var html = str.substr(0,400); | |
document.getElementById('content_div').innerHTML = html; | |
}; | |
gadgets.util.registerOnLoadHandler(getHtml); | |
</script> | |
]]> | |
</Content> | |
</Module> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment