Recommended
PDF
PDF
PDF
PDF
PDF
PostgreSQLとPGroongaで作るPHPマニュアル高速全文検索システム
PDF
PDF
PPTX
パフォーマンスの良いGASの書き方 Best Practice
PPTX
App Dojo 2017 12月 - VUI in your app with Dialogflow -
PPTX
PPTX
PPTX
Google Apps Scriptとは? Add-onとは?
PPTX
gcp ja night #27 Google Cloud Endpoints with Golang
PPTX
Tokyo gas #5_whatsnewinappsscript_公開用
PPTX
Dart flightschool cloudendpoint with dart
More Related Content
PDF
PDF
PDF
PDF
PDF
PostgreSQLとPGroongaで作るPHPマニュアル高速全文検索システム
PDF
PDF
PPTX
パフォーマンスの良いGASの書き方 Best Practice
More from 啓介 大橋
PPTX
App Dojo 2017 12月 - VUI in your app with Dialogflow -
PPTX
PPTX
PPTX
Google Apps Scriptとは? Add-onとは?
PPTX
gcp ja night #27 Google Cloud Endpoints with Golang
PPTX
Tokyo gas #5_whatsnewinappsscript_公開用
PPTX
Dart flightschool cloudendpoint with dart
GCPUG Shonan GAS & GAE 1. 2. 4. 6. 10. 11. 12. 13. 14. 15. 16. 17. 19. GAS
• Google Apps Script
–通称GAS、ガス、ギャス
–海外圏ではApps Script
• Googleが提供する
– サーバサイドスクリプト実行環境 & 開発ツール
• 2009年発
• 開発言語:JavaScript
ゴール 私と GAS 連携 別 その他
20. 21. 22. 23. GASの特徴
• 簡単
–3行でメール送信
–数行でGoogleサービス連携
ゴール 私と GAS 連携 別 その他
function myFunction() {
MailApp.sendEmail("gcpug@example.com", "テストタイトル", "本文");
}
function myFunction() {
var data = SpreadsheetApp.openById(id).getSheetByName("顧客名簿
").getRange("A2:D2").getValues()[0];
var email = data[0];
var name = data[1];
var subject = data[2];
var body = data[3];
MailApp.sendEmail(email, subject, body.replace(/name/mg, name));
}
24. 25. 26. 27. GASの特徴
• 自動化
– 時間指定やイベントドリブンで動かせる
• 時間指定
• 定期実行
– 分毎、日毎、週毎(曜日指定)、月毎
• Spread Sheetsの表示/更新
• Google Formに回答
• Google Sitesのリンク
• Google Docsを表示
• メニューからクリック
– UIも持てる
ゴール 私と GAS 連携 別 その他
28. 29. 30. 31. 32. 33. 34. • GASからGAE with OAuth2
– GAS側コード
– Session.getActiveUser()でoauth scopeを設定
– ScriptApp.getOAuthToken()でtoken取得
ゴール 私と GAS 連携 別 その他HTTPS ( &OAuth2)
35. • GASからGAE with OAuth2
– GAE側コード
– OAuth2認証を使う
ゴール 私と GAS 連携 別 その他HTTPS ( &OAuth2)
36. 37. 38. • GAEからGAS 1
– GAE側からurlfetchで呼びだす
– 認証は…(ゲフンゲフン
• 方法がないので基本secret keyでやる
•
ゴール 私と GAS 連携 別 その他HTTPS
39. • GAEからGAS 1
– 認証
• 厳密にはGAS->GAE同様の方法もある
GAS側
•
ゴール 私と GAS 連携 別 その他HTTPS
40. • GAEからGAS 1
– 認証
• 厳密にはGAS->GAE同様の方法もある
GAE側
•
ゴール 私と GAS 連携 別 その他HTTPS
41. 42. • GAEからGAS
–GASのExecution APIを利用する
• 資料作るのがアレだったので昔のBlogを…
– http://qiita.com/soundTricker/items/1bcfc5c9e80d29a7
ae4b
• Execution APIではService Accountが使えないの
で結構めんどいかも
ゴール 私と GAS 連携 別 その他Execution
API
44. • GAE Pub/Sub GAS
–単純にGAEの何かしらをふっくしてGASで
処理したいのであれば Pub/Subを使うパター
ンも有る
–GAE -> (Log) -> Cloud Logging -> Pub/Sub -
> GASのパターン
–適用例
• BigQueryにデータ突っ込む
• エラーログをSlackに流す
ゴール 私と GAS 連携 別 その他
45. • GAE Pub/Sub GAS
–http://qiita.com/soundTricker/items/a9569b5e
d71d15429444
ゴール 私と GAS 連携 別 その他
46. 47. 別の方法
• 直接APIコール
– ぶっちゃけ普通にAPIコールをすればよい
• そのほうが後々汎用性高いよ
• Datastore弄りたいなら
– GASからCloud Datastore API 呼べるよ
• Cloud Functions
– 最後の例はCloud Functionsで置き換えられるよ
– GAE -> (Log) -> Cloud Logging -> Pub/Sub -> Cloud
Functions のパターン
– めんどくさいから実際に動いてるコード見せるお
ゴール 私と GAS 連携 別 その他
48. 49. その他
• app_identify
– appengineでappengine周りの情報を取るモジュール
– access_tokenを取得できる 素敵
• google.appengine.ext.admin.application
– ローカルで動いているadmin画面が本番でも使える
– Pyhtonだとinteractiveコンソールが使える マジ素敵
• Cloud Playground
– appengine(python)用のweb playground
– あれどうだったけをちょろく試すのに便利
– https://cloud-playground.appspot.com/playground/
ゴール 私と GAS 連携 別 その他
50. We are hiring
人材募集中フロントエンド http://www.kabuku.co.jp/jobs/front-end-developer
バックエンド http://www.kabuku.co.jp/jobs/backend-developer
C/C++プログラマ http://www.kabuku.co.jp/jobs/cg-cad-programmer
※ 3Dプリンター/フィラメント使いたい放題の福利厚生付き