Soumettre la recherche
Mettre en ligne
Alt2017 1111 hatobus
•
Télécharger en tant que PPTX, PDF
•
2 j'aime
•
986 vues
B
Bus Hato
Suivre
Aizu LT 2017 0x09
Lire moins
Lire la suite
Ingénierie
Signaler
Partager
Signaler
Partager
1 sur 22
Télécharger maintenant
Recommandé
SQL Server 2017 Machine Learning Services (CLR-H in TOKYO #13)
SQL Server 2017 Machine Learning Services (CLR-H in TOKYO #13)
Tomoyuki Oota
私に作る時間がないのはどう考えても仕事が悪い!? (Gunma.web #10 2012/09/08)
私に作る時間がないのはどう考えても仕事が悪い!? (Gunma.web #10 2012/09/08)
parrotstudio
社内Lt
社内Lt
Keiichi Kayama
C++でできる!OS自作入門
C++でできる!OS自作入門
uchan_nos
とにかく楽してVue.jsでTypeScriptを使いたい
とにかく楽してVue.jsでTypeScriptを使いたい
さくらインターネット株式会社
農業とITをOSSで
農業とITをOSSで
Bus Hato
機械学習のはじめかた
機械学習のはじめかた
Bus Hato
What's the silicon valley internship program
What's the silicon valley internship program
Bus Hato
Recommandé
SQL Server 2017 Machine Learning Services (CLR-H in TOKYO #13)
SQL Server 2017 Machine Learning Services (CLR-H in TOKYO #13)
Tomoyuki Oota
私に作る時間がないのはどう考えても仕事が悪い!? (Gunma.web #10 2012/09/08)
私に作る時間がないのはどう考えても仕事が悪い!? (Gunma.web #10 2012/09/08)
parrotstudio
社内Lt
社内Lt
Keiichi Kayama
C++でできる!OS自作入門
C++でできる!OS自作入門
uchan_nos
とにかく楽してVue.jsでTypeScriptを使いたい
とにかく楽してVue.jsでTypeScriptを使いたい
さくらインターネット株式会社
農業とITをOSSで
農業とITをOSSで
Bus Hato
機械学習のはじめかた
機械学習のはじめかた
Bus Hato
What's the silicon valley internship program
What's the silicon valley internship program
Bus Hato
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Contenu connexe
En vedette
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
En vedette
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Alt2017 1111 hatobus
1.
自分専用のslack team &
botを作って 圧倒的進捗を得る A(izu)LT 会津編 0x09 @flying_hato_bus 飛ばすはとバス
2.
自己紹介 氏名 : 飛ばすはとバス
( @flying_hato_bus ) 世代 : s124 github : https://github.com/hatobus ハードウェアが好き,変なものが好き. 今年の夏休みにアメリカのシリコンバレーに行って来ました. 作った主なもの -> 自動で動く赤べこ, レーザーカッターで暗記パン 黄金比を手軽に見つけられる定規
3.
4.
5.
6.
なんでSlackbot作ったの 貧乏暇なしということで色々やることが たくさんある(授業, バイト, ゴミ出し,
課題) これ,Google calenderに登録してもいいけど,肝心の時に見てなくて困る. Slackだったら結構見るし,通知飛ばしてくれるからよくない?
7.
と言うわけで自分の秘書的なのを作りたくなった 名前 … Hatsonくん (某IBMのあれとグラハム
ベルの助手であるワトソンをもじった) 内容 … 授業の予定とかバイトでやることとか,課題の管理 天気,ゴミ出しの日を確認できる.
8.
仕様 サーバー Raspberry pi
3 言語,使用ライブラリ Python 3.5.4 + slackbot 使用API … Open weather map, google calender API
9.
とりあえず動かそう とりあえず動かしてみる.Slack team を作り,SlackのAPIキーとかを取得して,pythonファイルを作 っていく. 何個かファイルを作る必要があるが,ディレクトリ構造などは上の図を参照していただきたい. 設定ファイルのslackbot_settings.py
にAPIキーとデフォルトのリプライを設定して,run.pyにちょっと内容を書 くだけでなんとかなる
10.
11.
この調子でガンガン機能を積んでいく from slackbot.bot import
respond_to @botname: で反応するデコーダ from slackbot.bot import listen_to チャネル内発言で反応するデコーダ from slackbot.bot import default_reply 該当する応答がない場合に反応するデコーダ
12.
今後使っていくメソッド @respond_to('string') メンションがつけられたものに返事をする ‘string’の部分は正規表現で反応できる.
13.
今後使っていくメソッド @listen_to('string') botにメンションをつけないで発言した時に反応する. これも正規表現に対応.
14.
今後使っていくメソッド message.reply('string') @発言者名: string でメッセージを送信.リプライを送ってくれる message.send('string') string
を送信
15.
コードの例
16.
17.
天気について教えてもらえるようにする こういうのにもってこいなのが多分お天気の情報. スマホとかで手軽に調べることができるけど,そういうのも面倒な時は Hatsonくんに教えてもらえるようにする. 使用したAPI : Open
weather map ( https://openweathermap.org/ )
18.
要件 「 〇〇 の天気」とチャンネルに書くと,APIを叩いてお天気情報を教えてくれる Open
weather mapのAPIをpythonで叩いて,jsonファイルをスクレイピングして情報取得. 正規表現が使えるので 都市名の取得は「 (. * ) 」でできる. 場所を都市名と緯度経度で指定できたが,今回はpythonのGeocoderを使い,緯度経度で 天気を取得できるようにした.
19.
実装
20.
デモ
21.
作ってわかったこと これくらいじゃ†圧倒的進捗†は得られそうにないので,目下開発を進めていくしかない. TODOとしてはGoogleカレンダーと連携したい. -> やってみたらAPI周りで詰んだ
webの知識のNASA ゴミの日とかにメンション飛ばしてくれたらいいかなって感じ
22.
参考文献等 PythonのslackbotライブラリでSlackボットを作る Slack API 推奨Tokenについて Slackbotライブラリの公式レポジトリ Slide
shareの投稿 ( https://qiita.com/sukesuke/items/1ac92251def87357fdf6 ) ( https://qiita.com/ykhirao/items/3b19ee6a1458cfb4ba21 ) ( https://github.com/lins05/slackbot ) ( https://www.slideshare.net/BusHato/alt2017-1111-81874535 )
Télécharger maintenant