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

Patch for sb-slashdot



Please find attached a patch for sb-slashdot.el which adapts the shimbun
to the new site URLs.

Regards,
David
Index: ChangeLog
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/shimbun/ChangeLog,v
retrieving revision 1.194
diff -u -r1.194 ChangeLog
--- ChangeLog	14 May 2009 05:46:55 -0000	1.194
+++ ChangeLog	30 May 2009 17:05:14 -0000
@@ -1,3 +1,8 @@
+2009-05-30  David Engster  <dengste@xxxxxx>
+
+	* sb-slashdot.el (shimbun-slashdot-regexp-section-id-subject)
+	(shimbun-slashdot-get-headers): Adapt to new URL scheme.
+
 2009-05-14  Katsumi Yamaoka  <yamaoka@xxxxxxx>
 
 	* sb-yahoo.el (shimbun-get-headers): Don't stop fetching headers in
Index: sb-slashdot.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/shimbun/sb-slashdot.el,v
retrieving revision 1.7
diff -u -r1.7 sb-slashdot.el
--- sb-slashdot.el	16 Feb 2009 09:24:08 -0000	1.7
+++ sb-slashdot.el	30 May 2009 17:05:14 -0000
@@ -55,9 +55,8 @@
 Can be 'flat', 'thread', or 'nested'.")
 
 (defvar shimbun-slashdot-regexp-section-id-subject
-  "<\\s-*h3\\s-+class=\"story\"[^\0]*?<a\\s-.*\\s-href=\"\
-\\(?:/*\\([a-zA-Z]+\\)?\\.?slashdot.org/article.pl\\?sid=\\(.*?\\)\
-\\|.*slashdot.org/\\(.*?\\)/\\(.*?\\).shtml\\)\
+  "<\\s-*h3\\s-+class=\"story\"[^\0]*?<a [^>]*?href=\"\
+/*\\([a-zA-Z]+\\)?\\.?slashdot.org/\\([a-z]+?\\)/\\(.+\\)/\\(.+?\\)\
 \".*?>\\(.*?\\)</a>")
 
 (defvar shimbun-slashdot-regexp-author-time
@@ -92,9 +91,10 @@
     ;; Make article URL
     (while (re-search-forward shimbun-slashdot-regexp-section-id-subject
 			      nil t)
-      (setq section (or (match-string 1) (match-string 3))
-	    id (or (match-string 2) (match-string 4))
-	    url (concat "http://" section ".slashdot.org/article.pl?sid=" id
+      (setq section (match-string 1)
+	    id (match-string 3)
+	    url (concat "http://" (if section (concat section ".") "")
+			"slashdot.org/article.pl?sid=" id
 			"&simpledesign=1&lowbandwidth=1")
 	    subject (match-string 5))
       (if (null shimbun-slashdot-get-comments)