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
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
930
旅と技術のつながりを語る会 登壇資料 #travel_engineer
tom_furu
0
1.8k
IVS CTO NightのLTで使った資料 #ctonight
tom_furu
0
250
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
160
Other Decks in Technology
See All in Technology
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
670
AI for Science時代を切り開く、政府の次世代HPC戦略の展望
gpuunite_official
0
220
作って理解するCoding Agent 〜フレームワークに頼らないピュア Python での実装〜
takapy
3
1.1k
8bit CPU 2026
koba789
7
2.7k
tamachi.go 誕生の裏側
rymiyamoto
1
200
Kiro Crew入門 - 常駐エージェントの仕組みと使いどころ / Intro to Kiro Crew
k_adachi_01
1
830
Flutter × BLE Centralを自前Pluginで実装する設計パターン - MethodChannel / EventChannelで作る双方向ブリッジの実践 / Building Custom Flutter BLE Central Plugins: Bidirectional Bridging with Method & Event Channels
bitkey
PRO
0
240
Genie Codeハンズオン応用編
taka_aki
0
140
Kiro Crew で始める マルチエージェント開発
miu_crescent
PRO
0
160
VLMで2.3万枚のPyCon JP写真を検索!
terapyon
1
400
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.6k
フィジカルAIの知識ゼロの僕でも AIを使えばここまでできた
tatsuya1970
0
150
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
330
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
A Soul's Torment
seathinner
6
3.5k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
Design in an AI World
tapps
1
290
Everyday Curiosity
cassininazir
0
290
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Visualization
eitanlees
152
17k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
350
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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設定