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
Slackであそぼ!!
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Keisuke Mori
June 14, 2019
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Slackであそぼ!!
KFIE第一回LT会
コードはこちら→
https://gist.github.com/moririn772/de452d19f7c91bfce902e4d8201c16fc
Keisuke Mori
June 14, 2019
More Decks by Keisuke Mori
See All by Keisuke Mori
AWSを使う上で意識しておきたい、クラウドセキュリティ超入門(駆け足版)
kkmory
1
440
[JAWS-SG#02] 個人開発やハッカソンで役立つ、便利APIのつくりかた
kkmory
0
170
rubyonjets_with_aws_for_research
kkmory
0
620
AWSで動画変換&配信基盤を作った話
kkmory
0
260
Git-study-Hackz-treasure
kkmory
1
300
飯塚ブロックチェーン勉強会 #1
kkmory
0
160
Swarm: The distributed storage platform
kkmory
1
850
Kindai_Blockchain_study01
kkmory
0
270
Other Decks in Technology
See All in Technology
JSONataとAWS Step Functionsで目指すRuntimelessな世界
mu7889yoon
0
280
LLMに渡さなかった仕事
nanaism
0
1.1k
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
1
2.9k
AIエージェントの権限管理 3: Agentic RAG の Fine grained access control 編
ren8k
0
140
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
380
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
480
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
240
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
520
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
180
AIエージェントを最高のパートナーに育てる方法|評価と判断軸を育てる5つのステップ
koichiaoki
1
150
Claude Code本って、 読む必要あるの?
oikon48
2
490
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
180
Featured
See All Featured
Visualization
eitanlees
152
17k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Google's AI Overviews - The New Search
badams
0
1.6k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Designing Experiences People Love
moore
143
24k
Technical Leadership for Architectural Decision Making
baasie
3
570
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
460
Utilizing Notion as your number one productivity tool
mfonobong
4
590
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
How to build a perfect <img>
jonoalderson
1
6k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
Transcript
Slackであそぼ! KFIE第一回LT会 森 啓輔
自己紹介
もりけいすけ @moririn772
山崎ゼミ3年
Bitcoin
Ruby
None
None
ブロックチェーン ウェブ の人 Ruby }
であそぶ
None
≒
用意するもの
Slack Ruby heroku*1 *1 : 自動化したいなら必要
以上
やり方は簡単
Step 1
Slackの設定
開発者向けページに飛んで https://api.slack.com/
つくるアプリのいろいろを決めて
BOTをつくって
ワークスペースに追加!
か ら の
遊び場チャンネルをつくって
チャンネルにいれる! 今回は #playground とします
Step 2
コーディング
処理の流れ
全体の流れ 天気くれ!
全体の流れ 天気あげる〜
全体の流れ ごにょごにょ
全体の流れ 投稿して!
全体の流れ 投稿ぽーん!
全体の流れ おk
全体の流れ おk
全体の流れ やったー!
コードをみてみよう
HTTPを使えるようにする gem install http コンソール
Rubyファイルをつくる touch otenki.rb コンソール
ライブラリを読み込む require 'http' require 'json' require 'open-uri' require 'time' otenki.rb
お天気情報を取得する def get_and_format response = "" open(@uri) {|f| f.each_line {|l|
response << l} } format(response) end otenki.rb
必要な項目だけ抽出 w = JSON.parse(response) title = w["title"] text = w["description"]["text"]
time = Time.parse(w[“description"] [“publicTime"]).strftime("%Y %m݄%d") otenki.rb
Slackに投げる response = HTTP.post("https://ུ params: { token: 4IPKcPRmH9faFKaf, channel: “#playground”,
text: message, as_user: true, }) otenki.rb
完成形はこちら https://gist.github.com/moririn772/de452d19f7c91bfce902e4d8201c16fc
注意事項
このコードは このまま公開しないでね
Access Token = 秘密情報
response = HTTP.post("https://ུ params: { token: 4IPKcPRmH9faFKaf, channel: channel, text:
message, as_user: true, }) otenki.rb これ!!!!
Token があれば遊び放題 (流出すると悪用の危険)
環境変数で設定しましょう (詳しくはWEBで)
Step 3
やってみる
実行する ruby otenki.rb コンソール
None
えっ手動とか ダサくない?
平日の朝8:00に 教えてほしい
Heroku Scheduler https://elements.heroku.com/addons/scheduler
平日の8:00 とか 指定時間に 投稿できる
以前こんなものを…
まとめ
やったこと Slack側の設定 コードを書く 手動で動作確認
やってないこと 秘密情報の保護 自動化
続きはウェブで
まだ全然できてないです
今週末に公開予定(未定)
みんなもあそんでみよう !
余談
Rubyに興味がある "
Fukuoka.rb
毎週水曜日 天神のどこか もくもく会
もくもく会
ゆるーくどこかに集まって 各自もくもくと勉強したり 作業したり本を読んだり するだけの会
初心者大歓迎
興味がある人は 話しかけてね
ありがとうございました