All Projects → citizen428 → unsavory-legacy

citizen428 / unsavory-legacy

Licence: other
Removes outdated links from your Pinboard bookmarks

Programming Languages

ruby
36898 projects - #4 most used programming language

Discontinued! The new version is written in Go and can be found at github.com/citizen428/unsavory.

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]gmailcom>

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].