Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Goでコロナ感染者数をSlackに通知するスクリプトを作ってみた/gopherdojo_lt
Search
Hidetaka Okita
July 31, 2020
Programming
340
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Goでコロナ感染者数をSlackに通知するスクリプトを作ってみた/gopherdojo_lt
@Gopher道場#8 LT大会&卒業式
Hidetaka Okita
July 31, 2020
Other Decks in Programming
See All in Programming
Vue Fes Japan の “作る側”に関わってみて
naokihaba
1
190
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.4k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
150
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
160
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7k
sbt 2.0: takeoff
eed3si9n
0
170
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
10
7.7k
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
180
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.3k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
970
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Skip the Path - Find Your Career Trail
mkilby
1
260
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
Odyssey Design
rkendrick25
PRO
2
890
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
590
It's Worth the Effort
3n
188
29k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
960
Transcript
Goでコロナ感染者数をslackに通知する スクリプトを作ってみた 2020/07/31 Gopher道場#8 LT⼤会&卒業式 沖⽥ 英⾶ @hokita222
自己紹介 • 沖田英飛(hokita) • Twitter @hokita222 • 株式会社エニグモ / Backend
Engineer • Ruby on Rails 4年目 • 時々 Java / PHP / React • デグーを2匹飼っている Gopherじゃないよ、デグーだよ!
今日話すこと • Goの経験 • なぜGopher道場? • コロナ感染者数をSlackに通知するコマンド
Go経験 • 業務経験はゼロ • スクレイピングしたものをSlackに通知するスクリプト作成 • Goの技術書読んだ
なぜGopher道場? • OSS貢献のチャンスを逃した • slack-go/slack • https://github.com/slack-go/slack • Slack API用のライブラリ
• Slackの新機能を追加したかった。 • 実装は1行、だがテストが書けなかった。。 • https://github.com/slack-go/slack/pull/707/files • 独学つらい • Goらしい書き方わからない • 効率が悪い
念願のGopher道場で学ぶことができた!
corona_slack • コロナ感染者数を通知するスクリプト • https://github.com/hokita/corona_slack
仕様 • 世界のコロナ感染者数を取得できるAPIから情報をとってくる • https://disease.sh/ • 取ってくる情報は↓ • 日本の感染者数 •
世界感染者数上位国の感染者数 • 取ってきた情報をSlackに通知する • Incoming Webhook機能を利用する。 • https://api.slack.com/messaging/webhooks
動作 ←1000人超えちゃった! 通知できた! ←時々APIがtoday cases, today deathsが0を返す ときがある。
工夫したこと1 • 感染者数取得(API)とSlackへの通知を別パッケージに分けた。
工夫したこと2 • APIを叩くテスト用にモックサーバを用意した。 • Cf. http://www.inanzzz.com/index.php/post/fb0m/mocking-and-testing-http- clients-in-golang
工夫したこと3 • 環境変数からwebhook urlをセットできるようにした。
展望 • Slackへの通知を自作したい • 現在 slack-go/slack を使っている • slack-go/slack は多機能過ぎる
• モックが苦手なのを克服したい • main.goのテストとか特に苦手 • もっと大きいもの作りたい • DDD、クリーンアーキテクチャを意識したWebアプリ • gRPC 、マイクロサービス
ご清聴ありがとうございました!