Created
September 29, 2012 09:54
-
-
Save crtr0/3803605 to your computer and use it in GitHub Desktop.
LxJs Texting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Twilio API: http://twilio.com/api | |
// Twilio Node.js module: https://github.com/stevegraham/twilio-js | |
var Twilio = require('twilio-js') | |
, twilioNumber = "your SMS-enabled Twilio #"; | |
require('./creds')(Twilio); | |
// creds.js should look like: | |
// | |
// module.exports = function(Twilio) { | |
// Twilio.AccountSid = "ACxxxxxxxxx"; | |
// Twilio.AuthToken = "yyyyyyyyyyy"; | |
// }; | |
Twilio.Call.all(function(err, res) { | |
res.calls.forEach(function(call) { | |
Twilio.SMS.create({to: call.from, from: twilioNumber, body: "Your message here!"}, function(err, res) { | |
console.log("SMS " + (err ? "failed" : "succeeded") + " for: " + call.from); | |
}); | |
}); | |
}, {to: twilioNumber, pageSize: 500}); | |
// email carter@twilio.com to get expedited access to the Twilio EU Beta: http://www.twilio.com/eu-beta-signup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment