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
tom_furu
May 20, 2016
Technology
0
1.5k
社内勉強会資料(2016/05/16)
毎週やっている社内技術勉強会で使った資料です。
公開できない内容もあったので端折ったりマスクしたりしてます。
tom_furu
May 20, 2016
Tweet
Share
More Decks by tom_furu
See All by tom_furu
Collaboration Hack Meetup!! 登壇資料
tom_furu
0
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.1k
【Loco Partners】Slack×hubotハッカソン0919
tom_furu
0
140
Other Decks in Technology
See All in Technology
メルカリIBIS:AIが拓く次世代インシデント対応
0gm
2
400
Claude Codeは仕様駆動の夢を見ない
gotalab555
23
7k
AIと描く、未来のBacklog 〜プロジェクト管理の次の10年を想像し、創造するセッション〜
hrm_o25
0
110
Jamf Connect ZTNAとMDMで実現! 金融ベンチャーにおける「デバイストラスト」実例と軌跡 / Kyash Device Trust
rela1470
1
200
僕たちが「開発しやすさ」を求め 模索し続けたアーキテクチャ #アーキテクチャ勉強会_findy
bengo4com
0
2.5k
Findy Freelance 利用シーン別AI活用例
ness
0
670
全員が手を動かす組織へ - 生成AIが変えるTVerの開発現場 / everyone-codes-genai-transforms-tver-development
tohae
0
230
サイボウズフロントエンドの横断活動から考える AI時代にできること
mugi_uno
1
180
LLMで構造化出力の成功率をグンと上げる方法
keisuketakiguchi
0
990
MCP認可の現在地と自律型エージェント対応に向けた課題 / MCP Authorization Today and Challenges to Support Autonomous Agents
yokawasa
5
2.5k
GISエンジニアよ 現場に行け!
sudataka
1
140
Eval-Centric AI: Agent 開発におけるベストプラクティスの探求
asei
0
140
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
338
57k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
Agile that works and the tools we love
rasmusluckow
329
21k
BBQ
matthewcrist
89
9.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
A Modern Web Designer's Workflow
chriscoyier
695
190k
The Cult of Friendly URLs
andyhume
79
6.5k
Making Projects Easy
brettharned
117
6.3k
How to train your dragon (web standard)
notwaldorf
96
6.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
It's Worth the Effort
3n
186
28k
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設定