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
Picking Records with JavaScript and a Button
Search
Gordon Diggs
September 11, 2016
Technology
90
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Picking Records with JavaScript and a Button
Gordon Diggs
September 11, 2016
More Decks by Gordon Diggs
See All by Gordon Diggs
John Coltrane: Lessons in Leadership
gordondiggs
2
320
The Customer Gap
gordondiggs
1
130
Kafka Partitioning Algorithm
gordondiggs
0
170
Supbutton
gordondiggs
0
99
Rayons
gordondiggs
0
100
Sous Vide
gordondiggs
0
120
Dev Events & Internal Tools at Paperless Post
gordondiggs
0
130
The Joys and Pains of Working With an Old Codebase
gordondiggs
0
160
The Joys and Pains of Working with an Old Codebase
gordondiggs
1
2.4k
Other Decks in Technology
See All in Technology
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
170
サーバーフルコンピューティング?AWS Lambda
iwatatomoya
1
200
大阪オフィスに Unitree Go2 がやってきたので Physical AI やってみた
dafujii
0
260
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
160
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
230
全社共通データ基盤をつくる。ソニーのDatabricks活用とデータガバナンス設計の裏側
sony
0
340
営業オントロジーの作り方と、エージェントからの辿り方 ── ナレッジワークの現場から
kworkdev
PRO
1
240
Meet AgentCore Identity Consent Portal
hironobuiga
3
180
覗いてみよう 関数型ビジュアル言語×2Dグラフィックスの世界
yohyamasaki
0
170
2026-10-01_MagicPod_QAハーネスエンジニアリングとQA組織の未来像
ynisqa1988
1
470
Execution in the Kingdom of Agents: Reflections on Abstraction and Complexity
bcantrill
0
790
企業の現実世界をグラフで写し取る
sansantech
PRO
0
250
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
430
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
860
Odyssey Design
rkendrick25
PRO
2
850
KATA
mclloyd
PRO
35
16k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
290
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
540
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
Transcript
Picking Records with JavaScript and a Button ManhattanJS 20160914
Picking Records with JavaScript and a Button ManhattanJS 20160914
@GordonDiggs
None
None
None
None
None
Lambda Example Sources • S3 file created or deleted •
SNS event • Updates to a DynamoDB table
None
None
None
Requirements • Get a random record • Send a text
message with that record’s information
const env = require("node-env-file"); env(`${__dirname}/.env`); process.env.NODE_CONFIG_DIR = "/var/task/config"; const twilio
= require("twilio")(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN) , getJSON = require("get-json"); const getRecord = function(callback) { getJSON("https://rayons.info/items/random.json", function(err, item) { if (err) { console.log("got an error: ", err); callback(null); } else { const itemURL = `https://rayons.info/items/${item.id}`; callback(`You should listen to "${item.title}" by ${item.artist}: ${itemURL}`); } }); }; const sendSMS = function(message, callback) { twilio.sendMessage( { body: message, from: process.env.FROM_NUMBER, to: process.env.TO_NUMBER }, function(err, responseData) { console.log("Twilio response:", responseData); if (err) { callback("API request completed with error(s)."); } else { callback("API request sent successfully."); } } ); }; exports.handler = function (event, context) { getRecord(function(message) { if (message) { sendSMS(message, function(status) { context.done(null, status); }); } else { context.done(); } }); };
const env = require("node-env-file"); env(`${__dirname}/.env`); process.env.NODE_CONFIG_DIR = "/var/task/config"; const twilio
= require("twilio")(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN) , getJSON = require("get-json");
const getRecord = function(callback) { getJSON("https://rayons.info/items/random.json", function(err, item) { if
(err) { console.log("got an error: ", err); callback(null); } else { const itemURL = `https://rayons.info/items/${item.id}`; callback(`You should listen to "${item.title}" by ${item.artist}: ${itemURL}`); } }); };
const sendSMS = function(message, callback) { twilio.sendMessage( { body: message,
from: process.env.FROM_NUMBER, to: process.env.TO_NUMBER }, function(err, responseData) { console.log("Twilio response:", responseData); if (err) { callback("API request completed with error(s)."); } else { callback("API request sent successfully."); } } ); };
exports.handler = function (event, context) { getRecord(function(message) { if (message)
{ sendSMS(message, function(status) { context.done(null, status); }); } else { context.done(); } }); };
None
Thank you! • github.com/GordonDiggs/what_should_i_listen_to_lambda • aws.amazon.com/lambda • twitter.com/GordonDiggs • bitly.com/gd-lambda