[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

PATCH: Improve sb-emacswiki.el



Here's a small patch to sb-emacswiki.el which does three things:

1)  Gets the Wiki username into the From field of articles.
2)  Appends the description of the change to the end of the Subject line.
3)  Removes some (apparently) extraneous cddr's

sb-emacswiki could be used with *any* Oddmuse Wiki (odmuse.org).  But as-is
you'd have to create a new sb-* file for each Wiki.  Is there an easy way
to make it so you can enter a URL when creating an nnshimbun group?  If
there were, we could rename sb-emacswiki to sb-oddmuse and then it would
instantly work for any Oddmuse wiki.  This same concept could apply to other
Wiki software and to any RSS feeds or web pages that were created with the
same software.

If nobody else wants to, I'll try to do it.  (It might be easier for an
Shimbun expert than for me :)
--- emacs-w3m-cvs/shimbun/sb-emacswiki.el	2005-07-05 19:52:29.000000000 -0400
+++ w3m/shimbun/sb-emacswiki.el	2005-12-18 12:20:38.000000000 -0500
@@ -73,8 +73,8 @@
 	(setq url (and (listp item)
 		       (eq (intern (concat rss-ns "item")) (car item))
 		       (if (string= (shimbun-current-group shimbun) "changes")
-			   (shimbun-rss-node-text rss-ns 'link (cddr item))
-			 (shimbun-rss-node-text wiki-ns 'diff (cddr item)))))
+			   (shimbun-rss-node-text rss-ns 'link item)
+			 (shimbun-rss-node-text wiki-ns 'diff item))))
 	(when url
 	  (let* ((date (or (shimbun-rss-node-text dc-ns 'date item)
 			   (shimbun-rss-node-text rss-ns 'pubDate item)))
@@ -82,8 +82,11 @@
 	    (unless (shimbun-search-id shimbun id)
 	      (push (shimbun-create-header
 		     0
-		     (shimbun-rss-node-text rss-ns 'title item)
-		     (or (shimbun-rss-node-text dc-ns 'contributor item)
+                     (let ((desc (shimbun-rss-node-text rss-ns 'description item)))
+                       (concat (shimbun-rss-node-text rss-ns 'title item)
+                               (if desc
+                                   (concat " - " desc))))
+		     (or (shimbun-rss-node-text wiki-ns 'username item)
 			 (shimbun-from-address shimbun))
 		     (shimbun-rss-process-date shimbun date)
 		     id "" 0 0 url)