Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Removes outdated links from your Pinboard bookmarks

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 unsavory.gemspec
README.rdoc

unsavory – get rid of those stale bookmarks!

unsavory is a little Ruby script which checks your Pinboard bookmarks for dead links (ENOENT or HTTP status code 404) and removes them. Additionally it will also inform you about links which return a status code other than 200 (OK).

Installation

$ gem install unsavory

Options

unsavory [OPTIONS]

-h, --help:
   show help

-d, --dry-run:
   only log outdated links without deleting them

-p, --http-proxy:
   specify an HTTP proxy (e.g. --http-proxy="http://webproxy:8080")

-l, --log-file:
   location of the log file (default: ./unsavory.log)

Usage

You can start the program from the command-line like this:

$ unsavory

It will first check if it can find the configuration file '~/.unsavory', which should have the following format:

user:password

In case this file doesn't exist, HighLine will be used to prompt for login credentials. If this gem isn't available, the script will display an error message and abort.

While running unsavory will display a progressbar and an estimated time until completion:

Enter Pinboard username: citizen428
Enter Pinboard password: *************

citizen428 has 774 bookmarks.
Checking:        3% |o                                         | ETA:  00:09:34

It will also create a logfile which contains information on deleted URLs, as well as redirects and all HTTP response codes other than 200 (OK).

If you don't want to actually delete links, please use the '–dry-run' option (also available as '-n').

Warning

Any link that returns an HTTP status code of 404 will be deleted without warning. There's no undo, use at your own risk!

Todo

# Write tests. # Use tests to clean up code. # Add option to replace links with Archive.org links # Add option to update redirects

Thanks

# thelibrarian: for implementing HTTPS support and the '–dry-run' option # thomd: for adding proxy support

Author

Michael Kohl <citizen428[at]gmail[dot]com>

License

Copyright © 2009-2014 Michael Kohl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.