Browse code
reformat whitespace
fiddlerwoaroof authored on 19/08/2017 20:23:25
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -18,6 +18,7 @@ |
18 | 18 |
(defun test-feed-list () |
19 | 19 |
(values '("http://feeds.feedburner.com/GamasutraFeatureArticles/" |
20 | 20 |
"http://edwardfeser.blogspot.com/feeds/posts/default" |
21 |
+ "http://feeds.feedburner.com/undergroundthomist/yCSy" |
|
21 | 22 |
"https://www.codinghorror.com/blog/index.xml" |
22 | 23 |
"https://sancrucensis.wordpress.com/feed/") |
23 | 24 |
#p"/tmp/feed-archive/")) |
... | ... |
@@ -130,8 +131,8 @@ |
130 | 131 |
|
131 | 132 |
(defun archive-feeds-nondeterm () |
132 | 133 |
(let* ((pull-time (local-time:now)) |
133 |
- (pull-directory (get-store-directory-name pull-time)) |
|
134 |
- (index-path (merge-pathnames "index.json" pull-directory)) |
|
134 |
+ (pull-directory (get-store-directory-name pull-time)) |
|
135 |
+ (index-path (merge-pathnames "index.json" pull-directory)) |
|
135 | 136 |
(feed-stream-provider (make-instance 'alimenta.feed-archive.encoders:feed-stream-provider |
136 | 137 |
:if-exists :error |
137 | 138 |
:root pull-directory))) |
... | ... |
@@ -144,37 +145,37 @@ |
144 | 145 |
;; This is an ungodly mess, we need to avoid funneling everything through fix-pathname-or-skip |
145 | 146 |
(defun command-line-main (&optional (feed-list-initializer #'init-feeds)) |
146 | 147 |
(labels ((feed-type-unsupported (c &key (restart 'skip-feed)) |
147 |
- (format t "~&Feed type unsupported: ~a for feed ~a~%" |
|
148 |
- (alimenta:feed-type c) |
|
149 |
- (alimenta:feed-link c)) |
|
150 |
- (funcall restart)) |
|
151 |
- (fix-pathname-or-skip (c &key (restart 'skip-feed) (wrapped-condition nil wc-p)) |
|
152 |
- (typecase (or wrapped-condition c) |
|
153 |
- (alimenta:feed-type-unsupported (feed-type-unsupported c)) |
|
154 |
- (otherwise |
|
155 |
- (if (find-restart 'fix-pathname) |
|
156 |
- (fix-pathname) |
|
157 |
- (progn (unless (eq restart 'continue) |
|
158 |
- (format t "~&Skipping a feed... ~s~%" |
|
159 |
- (if wc-p |
|
160 |
- (alimenta.feed-archive.encoders:the-feed c) |
|
161 |
- "Unknown"))) |
|
162 |
- (funcall restart))))))) |
|
148 |
+ (format t "~&Feed type unsupported: ~a for feed ~a~%" |
|
149 |
+ (alimenta:feed-type c) |
|
150 |
+ (alimenta:feed-link c)) |
|
151 |
+ (funcall restart)) |
|
152 |
+ (fix-pathname-or-skip (c &key (restart 'skip-feed) (wrapped-condition nil wc-p)) |
|
153 |
+ (typecase (or wrapped-condition c) |
|
154 |
+ (alimenta:feed-type-unsupported (feed-type-unsupported c)) |
|
155 |
+ (otherwise |
|
156 |
+ (if (find-restart 'fix-pathname) |
|
157 |
+ (fix-pathname) |
|
158 |
+ (progn (unless (eq restart 'continue) |
|
159 |
+ (format t "~&Skipping a feed... ~s~%" |
|
160 |
+ (if wc-p |
|
161 |
+ (alimenta.feed-archive.encoders:the-feed c) |
|
162 |
+ "Unknown"))) |
|
163 |
+ (funcall restart))))))) |
|
163 | 164 |
|
164 | 165 |
(let ((error-count 0)) |
165 | 166 |
(handler-bind ((alimenta.feed-archive.encoders:feed-error |
166 |
- (op (fix-pathname-or-skip _1 :wrapped-condition (alimenta.feed-archive.encoders:the-condition _1)))) |
|
167 |
- (alimenta:feed-type-unsupported #'feed-type-unsupported) |
|
168 |
- ((or usocket:timeout-error |
|
169 |
- usocket:ns-error) (op (alimenta.pull-feed:skip-feed _))) |
|
170 |
- (error |
|
171 |
- (op |
|
172 |
- (format t "~&Error signaled, ~a (count ~d)" _1 error-count) |
|
173 |
- (incf error-count) |
|
174 |
- (unless (< error-count 15) |
|
175 |
- (format t " continuing~%") |
|
176 |
- (fix-pathname-or-skip _1 :restart 'continue))))) |
|
177 |
- (multiple-value-bind (*feeds* *feed-base*) (funcall feed-list-initializer) |
|
178 |
- (alimenta.pull-feed:with-user-agent ("Feed Archiver v0.1b") |
|
179 |
- (archive-feeds-nondeterm))))))) |
|
167 |
+ (op (fix-pathname-or-skip _1 :wrapped-condition (alimenta.feed-archive.encoders:the-condition _1)))) |
|
168 |
+ (alimenta:feed-type-unsupported #'feed-type-unsupported) |
|
169 |
+ ((or usocket:timeout-error usocket:ns-error |
|
170 |
+ ) (op (alimenta.pull-feed:skip-feed _))) |
|
171 |
+ (error |
|
172 |
+ (op |
|
173 |
+ (format t "~&Error signaled, ~a (count ~d)" _1 error-count) |
|
174 |
+ (incf error-count) |
|
175 |
+ (unless (< error-count 15) |
|
176 |
+ (format t " continuing~%") |
|
177 |
+ (fix-pathname-or-skip _1 :restart 'continue))))) |
|
178 |
+ (multiple-value-bind (*feeds* *feed-base*) (funcall feed-list-initializer) |
|
179 |
+ (alimenta.pull-feed:with-user-agent ("Feed Archiver v0.1b") |
|
180 |
+ (archive-feeds-nondeterm))))))) |
|
180 | 181 |
|