Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google Apps Scriptで三日坊主を克服する
Search
tadaken3
October 30, 2017
Programming
1
1.4k
Google Apps Scriptで三日坊主を克服する
10/31にGaiaxさんが主催の『Google Apps Script 活用ミートアップ』で使用した資料です。
https://gaiax.connpass.com/event/69200/
tadaken3
October 30, 2017
Tweet
Share
More Decks by tadaken3
See All by tadaken3
Exploratoryサーバーで構築した 戦略と実行を繋ぐSSoT分析環境
tadaken3
0
8
kubell 2025 エンジニアサマーインターンシップ
tadaken3
0
87
戦略と実行を繋ぐ活用ファーストのデータ分析基盤
tadaken3
0
15
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
1.1k
Exploratory:プロダクト活用度の話
tadaken3
0
76
[我が社のデータエンジニアリング現場]我が社が考える最強のデータ基盤・開発体制!
tadaken3
0
120
はじめてのWatchOSアプリ。はじめてのiOSアプリ
tadaken3
0
68
拡張現実を活用して幸福度をあげる方法
tadaken3
0
1.5k
LINE Notifyで作る健康習慣をサポートする仕組み
tadaken3
0
1.8k
Other Decks in Programming
See All in Programming
チームをチームにするEM
hitode909
0
430
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
gunshi
kazupon
1
130
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
330
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
140
Basic Architectures
denyspoltorak
0
160
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
920
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
700
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
310
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
150
ゆくKotlin くるRust
exoego
1
190
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
[SF Ruby Conf 2025] Rails X
palkan
0
680
A Modern Web Designer's Workflow
chriscoyier
698
190k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
32
WCS-LA-2024
lcolladotor
0
400
Tell your own story through comics
letsgokoyo
0
770
Done Done
chrislema
186
16k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
300
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
120
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
140
Transcript
Google Apps ScriptͰ ࡾओΛࠀ͢Δ @tadaken3
ࣗݾհ • λμέϯ(@tadaken3) • ژग़ • ෳۀɿ͍ͭྡʹITͷ͓ࣄʢhttps://tonari-it.comʣ • झຯɿࣗసंɺےτϨ •
ຊۀɿσʔλΞφϦετ
ےτϨͯ͠·͔͢ʁ
ےτϨ͍ͨ͠Ͱ͢ΑͶʁ
͔ͤͬ͘δϜ௨͍Λ࢝Ί͚ͨͲɺ • ࣄ͕ͯ͘͠ • ࠓɺӍ͔ͩΒ • ҿΈձʹ༠ΘΕͨ • Δؾ͕ग़ͳ͍ ͋Δ͋Δ
Google Apps ScriptͰࡾओΛࠀ͢Δ ؍ଌ͑͞Ͱ͖ΕׯবͰ͖Δɻ ׯবͰ͖ΔͳΒɺ੍ޚͰ͖Δɻ
ᶃߦಈͷه ᶆૹ৴ࢦࣔ ᶅܭࢉ݁Ռͷ อଘ ᶄܦաͷ ܭࢉ εϓϨουγʔτ εϚʔτϑΥϯ Google Apps
ScriptͰࡾओΛࠀ͢Δ Google Apps Script LINE Notify API
Google Apps ScriptͰࡾओΛࠀ͢Δ IFTTTͰϘλϯΛ࡞Δ
Google Apps ScriptͰࡾओΛࠀ͢Δ εϓϨουγʔτʹه
Google Apps ScriptͰࡾओΛࠀ͢Δ //IFTTTͷܗ͔ࣜΒ௨ৗͷʹม function toDateFromIFTTT(str){ str = String(str); str
= str.replace(/at.*/,"")//ਖ਼نදݱͰatΑΓޙΖͷ෦Λআ d = new Date(str); return d; } IFTTTͷܗࣜ(str)Λdateʹม
Google Apps ScriptͰࡾओΛࠀ͢Δ var ss = SpreadsheetApp.getActiveSpreadsheet(); //εϓϨουγʔτΛऔಘ var sheet
= ss.getSheetByName("log"); //γʔτΛऔಘ //γʔτͷ࠷ऴߦʹܦաΛܭࢉ͢ΔࣜΛηοτ͢Δ function setFormuraLastRow(){ //γʔτͷ༻ൣғͷ͏ͪ࠷ऴߦΛऔಘ var maxRow = sheet.getDataRange().getLastRow(); //Aྻͷ࠷ऴߦͷΛऔಘ var str = sheet.getRange(maxRow,1).getValue(); //εϓϨουγʔτ༻ͷࣜ var code = '=TODAY() - TO_DATE(B'+ maxRow+')'; //ϑΥʔϚοτͨ͠Ληοτ sheet.getRange(maxRow,2).setValue(toDateFromIFTTT(str)); //ࣜΛηοτ͢Δ sheet.getRange(maxRow,3).setFormula(code); } ܦաΛܭࢉ͢Δ
Google Apps ScriptͰࡾओΛࠀ͢Δ ܦա͕ܭࢉͰ͖ͨ
Google Apps ScriptͰࡾओΛࠀ͢Δ //LINEʹ௨ΛૹΔؔ function sentToLine(message){ var token = "ઌఔऔಘͨ͠ΞΫηετʔΫϯ";
var options = { "method" : "post", "payload" : "message=" + message, "headers" : {"Authorization" : "Bearer "+ token} }; UrlFetchApp.fetch("https://notify-api.line.me/api/notify",options); } LINE NotifyʹϝοηʔδΛૹΔ
Google Apps ScriptͰࡾओΛࠀ͢Δ function main(){ setFormuraLastRow() var maxRow = sheet.getDataRange().getLastRow();
var passDate = sheet.getRange(maxRow,3).getValue(); var message =""; //ܦա͕̏͘͠7Ҏ্ͩͬͨΒLINEʹ௨ΛૹΔ if (passDate==3 || passDate>=7){ message = "࠷ऴτϨʔχϯά͔Β"+ passDate + "ܦա͠·ͨ͠"; sentToLine(message); } } Θ࣮ͤͯ͢Δ
·ͱΊ • IFTTTΛͬͯγʔτʹߦಈΛه • GASͰܦաΛܭࢉͱૹ৴ఆ • LINE NotifyͰ௨ Google Apps
ScriptͰࡾओΛࠀ͢Δ
ଞʹ • Fitbit APIͱΘͤͯઁऔΧϩϦʔͱӫཆૉΛ௨ • ΰϛͷͷલʹ௨ • ༑ਓͷੜͷ1िؒલʹ௨ ͋ͳ͚ͨͩͷ ύʔιφϧτϨʔφʔ݉Ոఉbot͕࡞ΕΔ
– tadaken3 “ ےτϨʹGoogle Apps Scriptʹ ऴΘΓ͕ͳ͍”
ϒϩάͷಡऀొ͓ئ͍͠·͢ʂ http://tadaken3.hatenablog.jp
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠