Skip to content

Instantly share code, notes, and snippets.

@meandavejustice
Created June 4, 2014 20:40
Show Gist options
  • Save meandavejustice/2433ff2f6ef6ed9f1a30 to your computer and use it in GitHub Desktop.
Save meandavejustice/2433ff2f6ef6ed9f1a30 to your computer and use it in GitHub Desktop.
create butt.ly shortened links
var request = require('request');
var cheerio = require('cheerio');
var prompt = require('prompt');
prompt.start();
prompt.get(['url', 'keyword'], function (err, result) {
request.post('https://butt.ly/index.php', function(err, resp, body) {
var $ = cheerio.load(body);
console.log($('#shorturl').attr('value') + ' now refers to ' + result.url);
}).form({url:result.url, keyword: result.keyword});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment