Created
January 26, 2013 15:35
-
-
Save juanpabloaj/4642936 to your computer and use it in GitHub Desktop.
Google Apps script and fusion table query example
This file contains hidden or 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
| 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