Permalink
Browse files

(w3m-antenna-check-rss): Ignore future entries to display site

announcements.
  • Loading branch information...
1 parent 5f90e6b commit e306a741fb7fd14fbf85f0a0a61c12b4f6a876b2 tsuchiya committed Nov 6, 2009
Showing with 30 additions and 13 deletions.
  1. +5 −0 ChangeLog
  2. +25 −13 w3m-antenna.el
View
5 ChangeLog
@@ -1,3 +1,8 @@
+2009-11-06 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3m-antenna.el (w3m-antenna-check-rss): Ignore future entries to
+ display site announcements.
+
2009-11-03 Hideyuki SHIRAI <shirai@meadowy.org>
* mew-w3m.el (mew-w3m-region-cite-mark): Add new selection.
View
38 w3m-antenna.el
@@ -304,20 +304,32 @@ In order to use this function, `xml.el' is required."
(intern (concat rss-ns "link"))
channel))))
(setq dates (append
- (w3m-rss-find-el
- (intern (concat dc-ns "date"))
- channel)
- (w3m-rss-find-el
- (intern (concat dc-ns "date"))
- items)
- (w3m-rss-find-el 'pubDate channel)
- (w3m-rss-find-el 'pubDate items)))
+ (w3m-rss-find-el
+ (intern (concat dc-ns "date"))
+ channel)
+ (w3m-rss-find-el
+ (intern (concat dc-ns "date"))
+ items)
+ (w3m-rss-find-el 'pubDate channel)
+ (w3m-rss-find-el 'pubDate items)))
(when dates
- (setq date '(0 0))
- (dolist (tmp dates)
- (setq tmp (w3m-rss-parse-date-string (nth 2 tmp)))
- (when (w3m-time-newer-p tmp date)
- (setq date tmp))))))
+ ;; Ignore future entries to display site announcements.
+ (let ((now (current-time)))
+ (let ((low (+ (nth 1 now) 3600))) ; 3600 = clock skew margin
+ (setq now
+ (if (>= low 65536)
+ (list (1+ (car now))
+ (- low 65536)
+ (nth 2 now))
+ (list (car now)
+ low
+ (nth 2 now)))))
+ (setq date '(0 0))
+ (dolist (tmp dates)
+ (setq tmp (w3m-rss-parse-date-string (nth 2 tmp)))
+ (and (w3m-time-newer-p tmp date)
+ (w3m-time-newer-p now tmp)
+ (setq date tmp)))))))
(if (and link date)
(w3m-antenna-site-update site link date nil)
(w3m-antenna-check-page site handler))))))

0 comments on commit e306a74

Please sign in to comment.