My impetus for developing this was the desire to populate a hidden page on my blog with live data from a pair of funds, namely an ebay merchant account used as a rollover fund for donations, and a 529 account from an Ohio provider.
There is an excellent API for ebay merchant accounts that I was able to integrate quickly with App Engine. The blog page performs a poor man's AJAX call to an appspot.com servlet, which in turn queries the ebay API for a current balance, and in the end the dollar amount is returned to the blogspot XMLHttpRequest, where a simple DOM .innerHTML replace populates the browser window with the balance. Here's a quick rundown of the code:
Blogger hooks
Rollover account balance: <span id="pcfBalance">??</span><br /> <script> var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4){ document.getElementById('pcfBalance').innerHTML = xmlhttp.responseText; } }; xmlhttp.open("GET","http://[my application].appspot.com/pcfbal",true); xmlhttp.send(null); </script>
App Engine servlet