Skip to content

Instantly share code, notes, and snippets.

@hiromi2424
Created March 25, 2011 06:42
Show Gist options
  • Save hiromi2424/886458 to your computer and use it in GitHub Desktop.
Save hiromi2424/886458 to your computer and use it in GitHub Desktop.
one-liner for japan electricity usage api
<script type="text/javascript">(function () { $.ajax({type: "GET", url: "http://tepco-usage-api.appspot.com/latest.json", dataType: "jsonp", success: function (data) { document.write(parseInt(100 * data.usage/data.capacity) + "%"); } }); })(); </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment