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
LWWSxGASxSlack
Search
noviiro
December 07, 2019
Technology
0
230
LWWSxGASxSlack
noviiro
December 07, 2019
Tweet
Share
More Decks by noviiro
See All by noviiro
LaravelのCVE-2021-3129の脆弱性について.pdf
noviiro
0
88
My GAS Tips
noviiro
1
210
FileMaker Data API
noviiro
0
170
Tried to set up Mastodon instance for myself. ( ja )
noviiro
0
110
Several TIPS for making a single board computer a web server (ja)
noviiro
0
190
PINE64で遊んでみた
noviiro
0
360
Other Decks in Technology
See All in Technology
「ふりかえりのふりかえり」をふりかえり、実のあるふりかえりにする
naitosatoshi
0
230
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
6
470
日本におけるデータエンジニアリングのこれまでとこれから
foursue
14
2.7k
「手動オペレーションに定評がある」と言われた私が心がけていること / phpcon_odawara2024
blue_goheimochi
2
320
反実仮想機械学習とは何か
usaito
PRO
7
2.5k
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
110
The CloudCompare project by Dr. Daniel Girardeau-Montaut
kentaitakura
0
510
自動生成を活用した、運用保守コストを抑える Error/Alert/Runbook の一元集約管理 / Centralized management of Error/Alert/Runbook to minimize operational costs using automated code generation
biwashi
10
2.2k
PHPカンファレンス小田原2024
ysknsid25
3
670
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
14
35k
WebアプリケーションにおけるPDOの使い方入門 / phpcon odawara 2024
meihei3
2
440
社内勉強会運営のコツ
senoo
6
1.2k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Become a Pro
speakerdeck
PRO
10
4.5k
Agile that works and the tools we love
rasmusluckow
324
20k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
Optimising Largest Contentful Paint
csswizardry
7
2.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Building Better People: How to give real-time feedback that sticks.
wjessup
354
18k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
Ruby is Unlike a Banana
tanoku
96
10k
Transcript
Slackに天気予報を流すbotを つくるまで (或いはLivedoor Weather Web ServiceとGoogle Apps Scriptを使って Slackに天気予報を流すまで) ノブ@noviiro
#gunmaweb #37
もともとの動機
遡ること2~3年前 (Slackでカップルアプリを作ってみたとかが流行った頃)
Slackの自分用ワークスペースに何 かbotを入れてみたい...! (しかも手軽に)
(探す)
(天気予報を投稿する...?) (JSONだし簡単そう)
(しかもGoogle Apps Script ででき る…!?)
作った。
Livedoor Weather Web Service x Google Apps Script x Slack
連携に必要なもの • GASxSlack連携用ライブラリ 参照 :https://qiita.com/soundTricker/items/43267609a870fc9c7453 • Slack連携用に必要なアクセストークン ◦ 「ファイル」→「プロジェクトのプロパティ」→「スクリプトのプロパティ」 • 天気のJSONデータ(今回はLivedoor天気)
• 少しのJSの知識 • 少しのGASの知識 • BEER
JSONデータ 例:http://weather.livedoor.com/forecast/webservice/json/v1?city=100010 ※仕様は「お天気webサービス仕様」を参照してください。 (http://weather.livedoor.com/weather_hacks/webservice)
取得してslackに流したい情報 • 1日の天気予報 • 最高気温 • Livedoor天気へのリンク ※画像(gif)も取得できるけどslackは文字列と結合できなかっ た・・・?
実際はこんな具合です。
Slack x GAS楽しい!