Created
June 4, 2014 20:40
-
-
Save meandavejustice/2433ff2f6ef6ed9f1a30 to your computer and use it in GitHub Desktop.
create butt.ly shortened links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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