Created
January 13, 2016 19:45
-
-
Save audstanley/45931df1d7b1f427ff8b to your computer and use it in GitHub Desktop.
This file contains 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
request({'uri' : 'http://' + 'admin' + ':' + 'password2' + '@localhost:8080/gui/token.html'}, function(error, response, body) { | |
var regex = new RegExp('<div id=(?:\'|")token(?:\'|")[^>]+>(.*)</div>'); | |
var matches = regex.exec(body); | |
var ourToken = matches[1]; | |
console.log(response.body); | |
request({'uri' : 'http://' + 'admin' + ':' + 'password2' + '@localhost:8080/gui/?token=' + ourToken + '&action=add-url&s=' + lastTorrent, 'cookie': response.headers['set-cookie'].GUID}, function(error, more) { | |
console.log(more.body); | |
}); | |
jf.writeFileSync('/home/audstanley/slackberrypiratebot/json/output.json', response); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment