Created
July 14, 2012 14:34
-
-
Save codatory/3111640 to your computer and use it in GitHub Desktop.
Quick and Dirty tool for finding stale bookmarks on 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
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