Created
March 17, 2013 14:36
-
-
Save maxmechanic/5181800 to your computer and use it in GitHub Desktop.
Command-line script to pull links from 5by5 shownotes into Pinboard.
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
var shownotes = require('shownotes'); | |
var Pinboard = require('node-pinboard'); | |
var _ = require( 'underscore' ); | |
var argv = require('optimist').demand(['network', 'show', 'ep','token']).argv; | |
var pinboard = new Pinboard(argv.token); | |
linksToPinboard(argv.network, argv.show, argv.ep); | |
function linksToPinboard(network, show, episode) { | |
shownotes.get(network, show, episode, function (notes) { | |
var showTag = ''; | |
_.each(show.split(' '), function(word) { | |
showTag += word; | |
}); | |
_.each(notes.links, function(link) { | |
var options = { | |
url: link.url, | |
description: link.title, | |
tags: [network,showTag,episode].join(','), | |
extended: show + ': ' + notes.title + ' ' + notes.download | |
}; | |
pinboard.add(options, function (res) { | |
console.log(res); | |
}); | |
}); | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment