Skip to content

Instantly share code, notes, and snippets.

@djyde
Created February 25, 2015 18:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djyde/cc89cb00d5c8062a72bd to your computer and use it in GitHub Desktop.
Save djyde/cc89cb00d5c8062a72bd to your computer and use it in GitHub Desktop.
rm2magnet
// 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