From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64527 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.gnus.general Subject: RSS and annoying always-changing article fields. Date: Mon, 16 Apr 2007 19:58:06 +0200 Organization: Epita/LRDE Message-ID: <87lkgs5hht.fsf@lrde.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: sea.gmane.org 1176746334 23317 80.91.229.12 (16 Apr 2007 17:58:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2007 17:58:54 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13038@lists.math.uh.edu Mon Apr 16 19:58:47 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdVTS-0001SZ-JC for ding-account@gmane.org; Mon, 16 Apr 2007 19:58:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1HdVSt-0005y4-8A; Mon, 16 Apr 2007 12:58:11 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1HdVSr-0005xg-13 for ding@lists.math.uh.edu; Mon, 16 Apr 2007 12:58:09 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1HdVSk-000610-Bw for ding@lists.math.uh.edu; Mon, 16 Apr 2007 12:58:08 -0500 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HdVSi-0001EZ-00 for ; Mon, 16 Apr 2007 19:58:00 +0200 Original-Received: from localhost (ivr94-6-82-230-255-91.fbx.proxad.net [82.230.255.91]) by smtp3-g19.free.fr (Postfix) with ESMTP id DD5265E1A6 for ; Mon, 16 Apr 2007 19:57:59 +0200 (CEST) X-Website: http://michael.cadilhac.name Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEU/JREXDATg1LV8UCao i1fQpmoP3Nd6AAACa0lEQVQ4jWWUQW7jMAxFqZEPICJzAjXeM6W8dyNqX9ji/a8yn04xnWIEJLD9 LJH85DcJFyJV3erqPty8ExHfBikXSdn0WVezC0hOAQiA2nCsAHOqEnPe4k+puU8zw/t+xquqjRKA 4lHsmQBT8C5pDtBwfwH8VdcHI5+FHtjRxrQRwZsf3hNjZRKAPEzHEdH9mFNSYb5dQK3r8KM6ftNy KikAirDZFWdVkDqbxjGFbAcwbQCxxc8mPRHUGOcCIMgMACV23RfJTch3gC6ofT3qCdG0NyUUPfYF yQrKCIAnuYsgX2qPzW2i9sNrfSOSPPZQiygtCNlCjlpXJV38lIKshF/AZzsAMoArdCKNHfXukPuJ ImbLh+9J2gXwap0QpZ7NjZ7ekdkFcDiqPiLGcHmuvaG/AHgy62s52Lae1ABoA7D6d2kDoAvgbnyD ZutEd6lTHOXfYPHVJDH1K8a1+oyrjoZpAGn1x5pfwPr2E9yjxSpk50/gEyKgD/+BD/KzN3tQ13b8 Cx5loF0AgnZf5IUny9hRHQOYBllHDM+6s3oviZBu77mFjDm621Np3hkjR90wE1BkTYvhdDgDgCmR xWChFfcYAOqMm5NZkVWMur8AL5+oeMQOob2FmY76FiM+PrDDZypwGdqokSlAaQOmGH6mW8KpsOwl 0YOLedjSITr6scNRF8D4PesH33QmLrx8AzjpV/3kkg025w2gfAFYKCLluJAc4Ap+h18oo4S8wzaY klDsBUTiY8EZFkg5Iass75FubC9wd8qa0u9+gRxAsAKEaRAo6iB+vwCMGmdBjvgidQGA1ntMX4CS ZYGV/wADyL80LIX/UAAAAABJRU5ErkJggg== User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64527 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Hi! I've subscribed to some RSS feeds that update the fields of articles continuously with useless informations, such as the number of comments for the article. I've read some bug report in the list that look like this one, so it probably is the very same bug. Here's a proposal for that: adding a variable for ignored fields. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=nnrss.patch Content-Transfer-Encoding: quoted-printable Index: lisp/nnrss.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/nnrss.el,v retrieving revision 7.47 diff -c -r7.47 nnrss.el *** lisp/nnrss.el 24 Jan 2007 07:15:37 -0000 7.47 =2D-- lisp/nnrss.el 16 Apr 2007 17:50:48 -0000 *************** *** 50,55 **** =2D-- 50,66 ---- (defvoo nnrss-directory (nnheader-concat gnus-directory "rss/") "Where nnrss will save its files.") =20=20 + (defvoo nnrss-ignore-article-fields nil + "*List of fields that should be ignored when comparing RSS articles. + Some RSS feeds update article fields during their lives, such as the + number of comments or the times the articles have been seen. However, if + there is a difference between the local article and the distant one, + it is considered as a new article. To avoid this and discard some fields, + set this variable to the list of fields to be ignored. +=20 + For example, http://worsethanfailure.com requires this variable to be + set to '(slash:comments).") +=20 ;; (group max rss-url) (defvoo nnrss-server-data nil) =20=20 *************** *** 658,663 **** =2D-- 669,682 ---- =20=20 ;;; Snarf functions =20=20 + (defun nnrss-make-hash-index (item) + (setq item (remove-if + (lambda (field) + (when (listp field) + (memq (car field) nnrss-ignore-article-fields))) + item)) + (md5 (gnus-prin1-to-string item))) +=20 (defun nnrss-check-group (group server) (let (file xml subject url extra changed author date feed-subject enclosure comments rss-ns rdf-ns content-ns dc-ns *************** *** 693,699 **** (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")= ) xml))) (when (and (listp item) (string=3D (concat rss-ns "item") (car item)) ! (progn (setq hash-index (md5 (gnus-prin1-to-string item))) (not (gethash hash-index nnrss-group-hashtb)))) (setq subject (nnrss-node-text rss-ns 'title item)) (setq url (nnrss-decode-entities-string =2D-- 712,718 ---- (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")= ) xml))) (when (and (listp item) (string=3D (concat rss-ns "item") (car item)) ! (progn (setq hash-index (nnrss-make-hash-index item)) (not (gethash hash-index nnrss-group-hashtb)))) (setq subject (nnrss-node-text rss-ns 'title item)) (setq url (nnrss-decode-entities-string Index: lisp/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.1527 diff -C0 -r7.1527 ChangeLog *** lisp/ChangeLog 16 Apr 2007 12:25:04 -0000 7.1527 =2D-- lisp/ChangeLog 16 Apr 2007 17:50:53 -0000 *************** *** 0 **** =2D-- 1,9 ---- + 2007-04-16 Micha=EBl Cadilhac +=20 + * nnrss.el (nnrss-ignore-article-fields): New variable. List of fields + that should be ignored when comparing distant RSS articles with local + ones. + (nnrss-make-hash-index): New function. Create a hash index according + to the ignored fields. + (nnrss-check-group): Use it. +=20 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable TIA! =2D-=20 | Micha=EBl `Micha' Cadilhac | Isn't vi that text editor with = | | http://michael.cadilhac.name | two modes... One that beeps and = | | JID/MSN: | one that corrupts your file? = | `---- michael.cadilhac@gmail.com | -- Dan Jacobson - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (GNU/Linux) iD8DBQFGI7k0UJhDmOfFA3URAkjGAKDHahZr8XMstyVUrg3cRenATdfvOwCghXPE wLONj5jP/nPCuD1r3E3xSOk= =e5Ma -----END PGP SIGNATURE----- --==-=-=--