unsavory 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +0 -1
- data/README.rdoc +6 -6
- data/bin/unsavory +4 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15f3240c58eb76338fb87d8205795da49d5e0a1a
|
4
|
+
data.tar.gz: 49d1d0433d186bb9b3b77ab9ee41b42853992d29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2cc0a08e0b2237f1c00853533bdfa08dde24f5524bbb4225fa142984c951384964f50ebdc2fbdb719bd3005d2c9ce9544f1d6e8b415e8a7ff22efaa23ec916b
|
7
|
+
data.tar.gz: 60465bc83ddea4119ad05260fc311582ab06c5836d97e0063ea780c477a7404ee68b945bf2424db92560761a80f84fc0a0b375f1595fa4228f878c4312c0bf8a
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
= unsavory -- get rid of those stale bookmarks!
|
2
2
|
|
3
|
-
unsavory is a little Ruby script which checks your Pinboard bookmarks for dead links (HTTP status code 404) and removes them. Additionally it will also inform you about links which return a status code other than 200 (OK).
|
3
|
+
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).
|
4
4
|
|
5
5
|
== Usage
|
6
6
|
|
7
|
-
After installing unsavory with
|
7
|
+
After installing unsavory with
|
8
8
|
|
9
9
|
$ gem install unsavory
|
10
10
|
|
@@ -15,11 +15,11 @@ you can start it from the command-line like this:
|
|
15
15
|
It will first check if it can find the configuration file '~/.unsavory', which should have the following format:
|
16
16
|
|
17
17
|
user:password
|
18
|
-
|
18
|
+
|
19
19
|
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.
|
20
|
-
|
20
|
+
|
21
21
|
When run, unsavory will generate display a progressbar and an estimate time until completion:
|
22
|
-
|
22
|
+
|
23
23
|
Enter Pinboard username: citizen428
|
24
24
|
Enter Pinboard password: *************
|
25
25
|
|
@@ -27,7 +27,7 @@ When run, unsavory will generate display a progressbar and an estimate time unti
|
|
27
27
|
URLs: 3% |o | ETA: 00:09:34
|
28
28
|
|
29
29
|
It will also create a logfile name 'unsavory.log' in the directory where it was started. The log contains information on deleted URLs, as well as redirects and all HTTP response codes other than 200 (OK).
|
30
|
-
|
30
|
+
|
31
31
|
== Warning
|
32
32
|
|
33
33
|
Any link that returns an HTTP status code of 404 will be deleted without warning. There's no undo, use at your own risk!
|
data/bin/unsavory
CHANGED
@@ -58,6 +58,10 @@ urls.each_with_index do |url, idx|
|
|
58
58
|
Net::HTTP.start(uri.host, uri.port) do |http|
|
59
59
|
response = http.head(uri.path.size > 0 ? uri.path : "/")
|
60
60
|
end
|
61
|
+
rescue Errno::ENOENT
|
62
|
+
pinboard.delete(url)
|
63
|
+
logger.info "Deleted #{url}"
|
64
|
+
next
|
61
65
|
# In 1.8, TimeoutError does not inherit from StandardError
|
62
66
|
rescue StandardError, Timeout::Error => e
|
63
67
|
logger.error "#{e.message} - #{url}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unsavory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kohl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -38,7 +38,9 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.9.0
|
41
|
-
description:
|
41
|
+
description: unsavory is a little Ruby script which checks your Pinboard bookmarks
|
42
|
+
for dead links (ENOENT or HTTP status code 404) and removes them. Additionally it
|
43
|
+
will also inform you about links which return a status code other than 200 (OK).
|
42
44
|
email: citizen428@gmail.com
|
43
45
|
executables:
|
44
46
|
- unsavory
|
@@ -50,7 +52,8 @@ files:
|
|
50
52
|
- ./LICENSE
|
51
53
|
- ./README.rdoc
|
52
54
|
homepage: http://github.com/citizen428/unsavory
|
53
|
-
licenses:
|
55
|
+
licenses:
|
56
|
+
- MIT
|
54
57
|
metadata: {}
|
55
58
|
post_install_message:
|
56
59
|
rdoc_options: []
|