Skip to content

Instantly share code, notes, and snippets.

@glennblock
Last active May 15, 2017 17:09
Show Gist options
  • Save glennblock/af167c7c34b6f4867e49d252057dedae to your computer and use it in GitHub Desktop.
Save glennblock/af167c7c34b6f4867e49d252057dedae to your computer and use it in GitHub Desktop.
simple-json-webtask
// You can require 1000+ Node.js modules here. Search the full list here: https://tehsis.github.io/webtaskio-canirequire/
var request = require('request');
module.exports = function(ctx, cb) {
// Call to forismatic's API to get a random quote
request.get(
{
uri:'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json',
json: true
}, (err,resp, body) => {
cb(null, body);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment