Skip to content

Instantly share code, notes, and snippets.

@dtolb
dtolb / burrito.js
Last active February 8, 2016 21:48
Burrito
var bw = require('node-bandwidth');
var client = new bw.Client("u-{your_user_id}", "t-{your_token}", "{your_Secret}");
var Promise = require('bluebird');
var PhoneNumber = Promise.promisifyAll(bw.PhoneNumber);
var Message = Promise.promisifyAll(bw.Message);
var burritoNumber = '+1888222';
var sendMessage = function (message) {
console.log("Ordering Burrito");
@dtolb
dtolb / burritos.json
Created February 8, 2016 22:10
burritos.json
{ '+19192991705': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/hdKsVNAJv9t9u4YMXRc6FmXx' }
{ '+17026230824': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/Jteh8gLBfPj5MvPc97d2Esy8' }
{ '+19192991710': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/TRGdbjoRYTiRDd7ZG4ASbsE1' }
{ '+12056247316': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/EvL6Qnncw82HAMCA4nbwbJCf' }
{ '+19193716193': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/cxAinrNxLd6KrRuqyBgKoguq' }
{ '+19196702511': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/c8Q5wMbXuk4z7nWEHtMhCY32' }
{ '+19192991715': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/s7TnrTibxS5SrCJj4odGaNt1' }
{ '+14154624756': 'Chipotle: Almost there. Click here for your free burrito: https://rainchec
@dtolb
dtolb / burritos.js
Last active February 9, 2016 15:18
Burritos.json
[
{ '+19192991705': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/hdKsVNAJv9t9u4YMXRc6FmXx' },
{ '+17026230824': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/Jteh8gLBfPj5MvPc97d2Esy8' },
{ '+19192991710': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/TRGdbjoRYTiRDd7ZG4ASbsE1' },
{ '+12056247316': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/EvL6Qnncw82HAMCA4nbwbJCf' },
{ '+19193716193': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/cxAinrNxLd6KrRuqyBgKoguq' },
{ '+19196702511': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/c8Q5wMbXuk4z7nWEHtMhCY32' },
{ '+19192991715': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/s7TnrTibxS5SrCJj4odGaNt1' },
{ '+14154624756': 'Chipotle: Almost there. Click here for your free burrito: https:/
@dtolb
dtolb / sample.sh
Created February 10, 2016 14:24
Order number
// find your credentials http://ap.bandwidth.com/docs/security/
curl -v -X GET https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=818 \
-u {YOUR_TOKEN}:{YOUR_SECRET} \
-H "Content-type: application/json"
//Fill in the number below with the number found above!!
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{YOUR_USER_ID}/phoneNumbers \
-u {YOUR_TOKEN}:{YOUR_SECRET} \
-H "Content-type: application/json" \
@dtolb
dtolb / Coupons.json
Created February 12, 2016 14:09
Burrito Coupons
[
{ "+14155989166": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/o0Du8W. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" },
{ "+19192991704": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/Y06uIW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" },
{ "+14154292562": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/W0Xu1W. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" },
{ "+19194390814": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/j0QuNW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" },
{ "+14154651445": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/I06uDW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" },
{ "+14156128136": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/30CuqY. Expires 2/25. Reply FOIL to sign up for offers & alerts.
@dtolb
dtolb / callcallback.js
Created March 2, 2016 14:38
Express Call Handler
app.get('/callcallback', function (req, res) {
var response = new xml.Response();
var playAudio = new xml.PlayAudio({
url: 'https://s3.amazonaws.com/bwdemos/vday/vday.mp3'
});
var hangup = new xml.Hangup();
response.push(playAudio);
response.push(hangup);
res.send(response.toXml());
});
@dtolb
dtolb / msgcallback.js
Created March 2, 2016 14:38
Express Message Handler
app.get('/msgcallback', function(req, res) {
var response = {
to: req.query.from,
from: req.query.to,
text: getPhrase()
};
var text = req.query.text.toLowerCase();
switch(text) {
case 'i luv u':
response.media = [getPhoto()];
@dtolb
dtolb / Bootcamp.py
Created March 4, 2016 16:17
Bootcamp Code Snips
r = requests.get('https://api.github.com/events')
print(r.text)
r = requests.get('https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=919', auth=('{your_token}', '{your_secret'))
r = requests.get('https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=919',
auth=('{your_token}', '{your_secret'))
print(r.text)
@dtolb
dtolb / MMS.md
Last active February 27, 2024 13:33
MMS Examples

MMS Examples

MMS & SMS Curl

MMS no DLR cURL

curl -v -X POST https://api.catapult.inetwork.com/v1/users/{user-id}/messages \
@dtolb
dtolb / call.md
Created March 21, 2016 17:51
call