"use strict"; const Promise = require("bluebird"); const bhttp = require("bhttp"); module.exports = function shortenUrl(targetUrl) { return Promise.try(() => { return bhttp.get(`https://is.gd/create.php?format=simple&url=${encodeURIComponent(targetUrl)}`); }).then((response) => { return response.body.toString(); }); };