Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doGet(e) {
- var output;
- try
- {
- var query = e.parameter["q"];
- var response = UrlFetchApp.fetch(decodeURIComponent(query));
- output = {"result":"success", "response": JSON.parse(response.getContentText())};
- }
- catch(e)
- {
- output = {"result":"error", "error": "Unable to fetch"};
- }
- return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);
- }
Advertisement
Add Comment
Please, Sign In to add comment