Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Created January 26, 2013 15:35
Show Gist options
  • Select an option

  • Save juanpabloaj/4642936 to your computer and use it in GitHub Desktop.

Select an option

Save juanpabloaj/4642936 to your computer and use it in GitHub Desktop.
Google Apps script and fusion table query example
function readFacName(fac, city){
// public fusion table
// https://www.google.com/fusiontables/DataSource?docid=1tL67aacGcCyMfAg9PUo_-gp4qm74GDtFiCMtFg
var select = "select FACNAME from 1tL67aacGcCyMfAg9PUo_-gp4qm74GDtFiCMtFg ";
var where = "where FAC_ZIP5 = '" + fac + "' AND FAC_CITY = '" + city +"'";
var query = encodeURIComponent(select + where);
var url = "http://www.google.com/fusiontables/api/query?sql=" + query;
var response = UrlFetchApp.fetch(url, {method: "get"});
return response.getContentText();
}
function fTable() {
Logger.log(readFacName("94609","OAKLAND"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment