John's Iowa Data Call Code
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
var overview; | |
var overview_query_url = "https://www.google.com/fusiontables/api/query?sql=SELECT+PNCommunityType%2C+SUM('NumVoters')%2C+SUM('NumBallotBoxes')%2C+SUM('NumCountedBallotBoxes')%2C+SUM('VoteCount-Paul')%2C+SUM('VoteCount-Bachmann')%2C+SUM('VoteCount-Johnson')%2C+SUM('VoteCount-Gingrich')%2C+SUM('VoteCount-Santorum')%2C+SUM('VoteCount-Huntsman')%2C+SUM('VoteCount-Other')%2C+SUM('VoteCount-Roemer')%2C+SUM('VoteCount-Romney')%2C+SUM('VoteCount-Perry')%2C+SUM('VoteCount-Cain')+FROM+2486515&jsonCallback=?"; | |
function refreshData() { | |
// Hit the Google Fusion Table | |
$.getJSON(overview_query_url, function(data) { | |
overview = data; | |
// Do various things with the JSON data | |
}); | |
// Refresh every 2 minutes (1 min = 60000) | |
setTimeout( refreshData, 60000 * 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment