Skip to content

Instantly share code, notes, and snippets.

@skopp
Created July 28, 2013 06:00
Show Gist options
  • Save skopp/6097588 to your computer and use it in GitHub Desktop.
Save skopp/6097588 to your computer and use it in GitHub Desktop.
require 'pinboard'
require 'json'
pinboard = Pinboard::Client.new token: 'your:api:token'
readability = JSON.parse(File.read('path/to/your/readability/JSON/file'))
readability.each |article| do
pinboard.add({
:url => article['article__url'],
:description => article['article__title'],
:extended => article['article__excerpt'],
:toread => !article['archive'],
:dt => Time.parse("#{article['date_added']}-04").utc.strftime('%Y-%m-%dT%H:%M:%SZ') # stupid hack, because readability doesn't add the timezone
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment