Skip to content

Instantly share code, notes, and snippets.

@gaurav
Created August 24, 2011 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaurav/1167411 to your computer and use it in GitHub Desktop.
Save gaurav/1167411 to your computer and use it in GitHub Desktop.
Simple code to download a Fusion Table which is being shared publically
#!/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