Created
August 24, 2011 06:19
-
-
Save gaurav/1167411 to your computer and use it in GitHub Desktop.
Simple code to download a Fusion Table which is being shared publically
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
#!/usr/bin/python | |
import urllib | |
tableid = 1344517 # A dummy but public fusion table I created | |
sql = "SELECT * FROM %d" % tableid | |
file = urllib.urlopen("https://www.google.com/fusiontables/api/query?sql=" + urllib.quote_plus(sql)) | |
print file.read() | |
# Expected output: | |
# Text,Number,Location,Date | |
# Test1,12,, | |
# Test2,13,, | |
# The Answer,42,Betelguese, | |
file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment