Skip to content

Instantly share code, notes, and snippets.

View NickHolcombe's full-sized avatar

Nick NickHolcombe

View GitHub Profile
@NickHolcombe
NickHolcombe / twilio-json.js
Last active April 3, 2020 11:22
Twilio function to turn a JSON object into menu options that play a podcast - from https://www.brightec.co.uk/blog/podcasting-to-those-without-internet-access
exports.handler = function(context, event, callback) {
let twiml = new Twilio.twiml.VoiceResponse();
var fetch = require('node-fetch');
// Define the list of sermons and fetch the data
const url = '<enter the URL of the json object to read>';
fetch(url)
.then(response => response.json())
.then(function(data) {
// Validate we have some sermon data