This example will discuss how to use the NXSL API within a google module.
The following code imports the NXSL API, uses _IG_FetchContent() to make a REST request of a Flickr service and processes the returned XML document.
<script src=”http://www.google.com/js/nxsl.1.js” type=”text/javascript”></script>
<script type=”text/javascript”>
_IG_FetchContent(’http://www.flickr.com/services/rest/
?api_key=YourKey&method=flickr.people.findByUsername
&username=brettf’, function (responseText){
var nxsl = xmlParse(responseText)
var user_id = xmlParse(’<div select=”//user” content=”@id”></div>’);
nxslProcess(nxsl, user_id);
alert(xmlText(user_id));
};
);
</script>
And the returned Flickr document
<rsp [...]