Created
February 25, 2015 18:29
-
-
Save djyde/cc89cb00d5c8062a72bd to your computer and use it in GitHub Desktop.
rm2magnet
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
// rmdown URL to magnet | |
// Usage: | |
// $ node index.js http://www.rmdown.com/link.php?hash=151f9114f14a0053fdbb8310045fb90f71935e7901c | |
// magnet:?xt=urn:btih:1f9114f14a0053fdbb8310045fb90f71935e7901c | |
// had copy to clipboard! | |
// Randy 2015 | |
// djyde.github.io | |
var argv = process.argv.slice(2); | |
function pbcopy(data) { var proc = require('child_process').spawn('pbcopy'); proc.stdin.write(data); proc.stdin.end(); } | |
pbcopy('magnet:?xt=urn:btih:' + argv[0].split('=')[1].slice(2)) | |
console.log('magnet:?xt=urn:btih:' + argv[0].split('=')[1].slice(2),'\n had copy to clipboard!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment