Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
This work is licensed under a
Creative Commons
Attribution 4.0 Unported
License. CC-BY mhawksey
Google Apps Script:
+Marti...
CC-BY-NC-ND lukexmartin
CC-BY-NC Xtream_i
https://flic.kr/p/tYTwd
Google Apps Script
CC-BY Google – Google Apps Script, 13-03-2012
JavaScript in the cloud
Apps Script is based on JavaScript 1.6,
plus a few features from 1.7 and 1.8.
A brief history
2009
Scripts in Sheets
Custom functions
2010
UiApp*
Web Apps (run as
developer)
Script Gallery*
2011
Scrip...
Where..
StandaloneSheets DocsForms Sites
Integration
CC-BY-NC Eugen Stoll
https://flic.kr/p/5c6ce
One liners
One liners
One liners
One liners{ish}
Toast
Custom UI
CC-BY Google Inc. Apps Script Menus
Auth
One liners services
Calendar
Contacts
Document
Drive
Forms
Gmail
Groups
Language
Maps
Sites
Spreadsheet
One{ish} liners services
AdSense
Analytics
Apps Activity
BigQuery
Calendar
Classroom
Drive
DoubleClick Campaigns
Fusion Ta...
Advanced Services
…fetch
BY-NC-SA tarteme
https://flic.kr/p/bAoEyi
“
…fetch
UrlFetchApp.fetch(url, params);
This service allows scripts to access other resources on the
web by fetching URLs...
Comparing
CiviEvent
registrations for
annual events and
automatically
reporting on a daily
basis
Problem
CiviReport
“
Scheduled Jobs - Mail Reports (mail_report)
26
Triggers
Trigger
// set the script to read the email run 15min later
ScriptApp.newTrigger("processInbox")
.timeBased()
.after(15 * ...
Hello Libraries
Libraries
https://plus.google.com/+SpencerEastonCCS/posts/hrQ9eaHMUW6
Identity
CC-BY-NC Thomas Hawk
https://flic.kr/p/bUy6wK
Google Apps Script Web apps
HtmlService: Templating
function doGet() {
return HtmlService
.createTemplateFromFile('Index')
.evaluate()
.setSandboxMode...
HtmlService: Communicate with Server
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index')
.setSandboxMo...
HtmlService
HtmlService
ContentService
function doGet() {
return ContentService.createTextOutput('Hello, world!');
}
function doGet(request) {
var...
“
ContentService
ContentService supports returning
TEXT, ATOM, CSV, iCal, JavaScript,
JSON, RSS, vCard, and XML
“
Execution API
The Apps Script Execution API is a REST
interface that lets a third-party application call
a function defi...
“
Properties Service
store simple data in key-value pairs scoped to
one script, one user of a script, or one
document
getS...
Let's play…
CC-BY-NC-ND Elke Noda
https://flic.kr/p/58zapN
https://tags.hawksey.info/
TAGS Summary
TAGSExplorer
TwtrService
[my link]
Advanced Services
Google Analytics
Google Analytics
[demo link]
Google Analytics
Twitter referral mashed with Google Analytics
Translation
Maps
Google Add-ons
CC-BY gail heidel
https://flic.kr/p/65aFCx
Add-ons in action
Domain distribution
Community
Danke!
+MartinHawksey
@mhawksey
EdTech Explorer
mashe.hawksey.info
http://go.alt.ac.uk/GDGBerlin-AppsScript
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Upcoming SlideShare
Loading in …5
×

Google Apps Script: The authentic{ated} playground [2015 Ed.]

2,365 views

Published on

This is the 2015 edition of my Google Apps Script: The authentic{ated} playground talk most recently given to GDG Berlin (Dec. 2015).

With a pre-authenticated cloud-based ecosystem Google Apps Script makes it possible to integrate into other Google services with a couple of lines of code. This turns Google Drive into a rich playground for a wide range of solutions from custom reporting using Google Sheets as a data interface; quick hacks to get the job done; custom interfaces for Docs, Sheets and Forms; to full blown application deployment to web and mobile. In this talk the main features and affordances of Google Apps Script are highlighted, this will be followed by a deep dive into a demonstration into how Google Apps Script makes it easy to combine Google Analytics with other data sources such as Twitter and do many more playful things.

Published in: Technology
  • Like Watching Videos? Want to get paid to do it? ■■■ https://tinyurl.com/rbrfd6j
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Google Apps Script: The authentic{ated} playground [2015 Ed.]

  1. 1. This work is licensed under a Creative Commons Attribution 4.0 Unported License. CC-BY mhawksey Google Apps Script: +Martin Hawksey @mhawksey The authentic{ated} playground http://go.alt.ac.uk/GDGBerlin-AppsScript
  2. 2. CC-BY-NC-ND lukexmartin
  3. 3. CC-BY-NC Xtream_i https://flic.kr/p/tYTwd
  4. 4. Google Apps Script CC-BY Google – Google Apps Script, 13-03-2012
  5. 5. JavaScript in the cloud Apps Script is based on JavaScript 1.6, plus a few features from 1.7 and 1.8.
  6. 6. A brief history 2009 Scripts in Sheets Custom functions 2010 UiApp* Web Apps (run as developer) Script Gallery* 2011 Scripts in Sites GUI Builder* More services 2012 Standalone scripts HTMLSerivce ScriptDb* Web Apps (run as user) Libraries and versioning Content Service Chrome Web Store 2013 Scripts in Doc Scripts in Forms Auth flow More services 2014 Add-on for Documents, Sheets and Forms IFRAME for HTMLService * Denotes deprecated services/features Adapted from Wesley Chun’s Google Apps Script 2015 Execution API 2016 ???
  7. 7. Where.. StandaloneSheets DocsForms Sites
  8. 8. Integration CC-BY-NC Eugen Stoll https://flic.kr/p/5c6ce
  9. 9. One liners
  10. 10. One liners
  11. 11. One liners
  12. 12. One liners{ish}
  13. 13. Toast
  14. 14. Custom UI CC-BY Google Inc. Apps Script Menus
  15. 15. Auth
  16. 16. One liners services Calendar Contacts Document Drive Forms Gmail Groups Language Maps Sites Spreadsheet
  17. 17. One{ish} liners services AdSense Analytics Apps Activity BigQuery Calendar Classroom Drive DoubleClick Campaigns Fusion Tables Gmail Google+ Google+ Domains Mirror Prediction Shopping Content Tasks URL Shortener YouTube
  18. 18. Advanced Services
  19. 19. …fetch BY-NC-SA tarteme https://flic.kr/p/bAoEyi
  20. 20. “ …fetch UrlFetchApp.fetch(url, params); This service allows scripts to access other resources on the web by fetching URLs. A script can use the UrlFetch service to issue HTTP and HTTPS requests and receive responses. The UrlFetch service uses Google's network infrastructure for efficiency and scaling purposes.
  21. 21. Comparing CiviEvent registrations for annual events and automatically reporting on a daily basis Problem
  22. 22. CiviReport
  23. 23. “ Scheduled Jobs - Mail Reports (mail_report)
  24. 24. 26
  25. 25. Triggers
  26. 26. Trigger // set the script to read the email run 15min later ScriptApp.newTrigger("processInbox") .timeBased() .after(15 * 60 * 1000) .create();
  27. 27. Hello Libraries
  28. 28. Libraries https://plus.google.com/+SpencerEastonCCS/posts/hrQ9eaHMUW6
  29. 29. Identity CC-BY-NC Thomas Hawk https://flic.kr/p/bUy6wK
  30. 30. Google Apps Script Web apps
  31. 31. HtmlService: Templating function doGet() { return HtmlService .createTemplateFromFile('Index') .evaluate() .setSandboxMode(HtmlService.SandboxMode.IFRAME); } CODE.GS <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> Hello, World! The time is <?= new Date() ?>. </body> </html> INDEX.HTML < CC-BY Google >
  32. 32. HtmlService: Communicate with Server function doGet() { return HtmlService.createHtmlOutputFromFile('Index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function doSomething() { Logger.log('I was called!'); } CODE.GS <!DOCTYPE html> <html> <head> <base target="_top"> <script> google.script.run.doSomething(); </script> </head> </html> INDEX.HTML < CC-BY Google >
  33. 33. HtmlService
  34. 34. HtmlService
  35. 35. ContentService function doGet() { return ContentService.createTextOutput('Hello, world!'); } function doGet(request) { var events = CalendarApp.getEvents( new Date(Number(request.parameters.start) * 1000), new Date(Number(request.parameters.end) * 1000)); var result = { available: events.length == 0 }; return ContentService.createTextOutput( request.parameters.prefix + '(' + JSON.stringify(result) + ')') .setMimeType(ContentService.MimeType.JAVASCRIPT); } JSONP TXT < CC-BY Google >
  36. 36. “ ContentService ContentService supports returning TEXT, ATOM, CSV, iCal, JavaScript, JSON, RSS, vCard, and XML
  37. 37. “ Execution API The Apps Script Execution API is a REST interface that lets a third-party application call a function defined in an Apps Script project and receive a response. This API lets you expose the full utility of Apps Script to any application, including Android and iOS apps. ...can be used with Google APIs Client Libraries
  38. 38. “ Properties Service store simple data in key-value pairs scoped to one script, one user of a script, or one document getScriptProperties() getUserProperties() getDocumentProperties()
  39. 39. Let's play… CC-BY-NC-ND Elke Noda https://flic.kr/p/58zapN
  40. 40. https://tags.hawksey.info/
  41. 41. TAGS Summary
  42. 42. TAGSExplorer
  43. 43. TwtrService
  44. 44. [my link]
  45. 45. Advanced Services
  46. 46. Google Analytics
  47. 47. Google Analytics
  48. 48. [demo link] Google Analytics
  49. 49. Twitter referral mashed with Google Analytics
  50. 50. Translation
  51. 51. Maps
  52. 52. Google Add-ons CC-BY gail heidel https://flic.kr/p/65aFCx
  53. 53. Add-ons in action
  54. 54. Domain distribution
  55. 55. Community
  56. 56. Danke! +MartinHawksey @mhawksey EdTech Explorer mashe.hawksey.info http://go.alt.ac.uk/GDGBerlin-AppsScript

×