Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
"use strict";
const querystring = require("querystring");
const request = require('request-promise');
module.exports = async (context, callback) => {
const article = querystring.escape(context);
const uri = `${article}&redirects=true`;
let response = await request({
json: true
callback(undefined, response.query.pages[Object.keys(response.query.pages)[0]].extract);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment