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
社内勉強会資料(2016/05/16)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
tom_furu
May 20, 2016
Technology
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
社内勉強会資料(2016/05/16)
毎週やっている社内技術勉強会で使った資料です。
公開できない内容もあったので端折ったりマスクしたりしてます。
tom_furu
May 20, 2016
More Decks by tom_furu
See All by tom_furu
Collaboration Hack Meetup!! 登壇資料
tom_furu
0
1.1k
最新AWS活用事例LT大会!(ビール付き) 登壇資料 #loco_meetup_night
tom_furu
0
920
旅と技術のつながりを語る会 登壇資料 #travel_engineer
tom_furu
0
1.8k
IVS CTO NightのLTで使った資料 #ctonight
tom_furu
0
240
DevOps勉強会の発表で使った資料 #devops_LT
tom_furu
0
210
Slack x Hubot 勉強会の発表で使った資料 #hubot_LT
tom_furu
1
1.2k
【Loco Partners】Slack×hubotハッカソン0919
tom_furu
0
150
Other Decks in Technology
See All in Technology
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
400
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
200
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
910
200個のGitHubリポジトリを横断調査したかった
icck
0
130
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
150
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
2
610
Snowflakeと仲良くなる第一歩
coco_se
4
490
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
2.4k
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
680
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
20260619 私の日常業務での生成 AI 活用
masaruogura
1
220
【Cyber-sec+】経営層を"動かす"ための考え方
hssh2_bin
0
190
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
150
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
620
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Transcript
FB Chatbot 2016/05/16 古田
FB Chatbot 作成 Facebook Messengerのbotを作りたい! (こちらはイメージです)
採用理由:運用面&コスト面で有利と判断 デプロイなど別管理にしたく relux本体のリポジトリとは切り離す。 このためだけにサーバを立てるのも勿体ないので Lambdaを利用。 RDSへ接続できるようになったし、せっかくだから Try。 構成 やりとり メッセージ
relux データ API gateway Lambda DynamoDB RDS
VPC AZ-a AZ-c インターネット ゲートウェイ Lambda用に サブネット作成 NAT ゲートウェイ
API gateway
Lambda(設定)
Lambda(FBからの認証) tokenを判別 var verify_token = 'XXXXXXXX'; exports.handler = function(event, context,
callback) { // Webhooks統合を有効にするための処理 if (event.verify_token === verify_token) { console.log('verify_token is correct'); callback(null, parseInt(event.challenge)); } callback(null, 'Error, wrong validation token'); };
Lambda(機能) function classifyMessageType(text) { // AAAですか? if (isAAAText(text)) { return
DATA_TYPE_AAA; } // BBBですか? if (isBBBText(text)) { return DATA_TYPE_BBB; } // CCCですか? if (isCCCText(text)) { return DATA_TYPE_CCC; } // DDDですか? if (isDDDText(text)) { return DATA_TYPE_DDD; } // それ以外ですね return DATA_TYPE_OTHER; } メッセージ種別判断 var aws = require('aws-sdk'); var dynamo = new aws.DynamoDB(); var tableName = "table-name"; function saveMessage(senderId, type, value) { var dynamoRequest = { "TableName" : tableName }; var nowTheTime = new Date(); var nowTheTimeStr = getTimeString(nowTheTime); dynamoRequest.Item = { "sender" : { "N" : String(senderId) }, "date" : { "S" : nowTheTimeStr }, "type" : { "S" : type }, "value" : { "S" : value } }; dynamo.putItem(dynamoRequest, function (err, data) {}); } メッセージ保存
Facebook設定
Facebook設定