Skip to content

Instantly share code, notes, and snippets.

@codatory
Created July 14, 2012 14:34
Show Gist options
  • Save codatory/3111640 to your computer and use it in GitHub Desktop.
Save codatory/3111640 to your computer and use it in GitHub Desktop.
Quick and Dirty tool for finding stale bookmarks on Pinboard
require 'pinboard_api'
require 'peach'
require 'typhoeus'
hydra = Typhoeus::Hydra.new
PinboardApi.username = ''
PinboardApi.password = ''
pins = PinboardApi::Post.all
@success = []
@fail = []
pins.peach(10) do |pin|
request = Typhoeus::Request.new(pin.url, :follow_location => true)
request.on_complete do |response|
if response.success?
@success << pin
else
@fail << pin
end
end
hydra.queue request
end
hydra.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment