unsavory — get rid of stale Delicious bookmarks

06 06 2009

While browsing through my Delicious bookmarks the other day, I realized that over time I had accumulated quite a few dead links (about 5% of my collection). I then looked for a simple tool to automatically remove them, but couldn’t find one that appealed to me, so I wrote my own script called unsavory which you can find on GitHub:

http://github.com/citizen428/unsavory/tree/master

It uses HTTParty to generate a list of all your bookmarks, which then get checked individually with Net::HTTP. Every link that returns an HTTP status code of 404 will automatically be removed (no questions asked, no undo), links with a status code other than 200 (OK) won’t be changed but will display some information in case you want to fix them manually. Here’s some example output (links anonymized for this post):

  Enter Delicious username: citizen428
  Enter Delicious password: *********

citizen428 has 664 bookmarks. Processing URL #0001: OK Processing URL #0002: OK Processing URL #0003: OK Processing URL #0004: OK Processing URL #0005: OK ... Processing URL #0013: 405: http://... ... Processing URL #0074: 302: http://... ... Processing URL #0086: Connection reset by peer – https://...

Not bad for under 60 lines of code. :-) I hope this is useful to some of you, I do have some features I plan on adding to this in the future.



Trackbacks


No Trackbacks

Comments

Display comments as (Linear | Threaded)
06 06 2009
#1 berq (Reply)

oho that’s cok güzel…


Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Textile-formatting allowed

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


Standard emoticons like :-) and ;-) are converted to images.