Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Get more results from google searches in nnweb.el
@ 2002-06-05 14:05 Niklas Morberg
  2002-06-11 19:55 ` Simon Josefsson
  0 siblings, 1 reply; 2+ messages in thread
From: Niklas Morberg @ 2002-06-05 14:05 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

(Thank you Simon and David for the help with viewing hidden
buffers, I wouldn't have been able to complete this
otherwise.)

Here's a patch that honors the value of nnweb-max-hits.
Currently, you only get the first 100 results from google,
but this patch should fix that.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnweb.el.diff --]
[-- Type: text/x-patch, Size: 1203 bytes --]

cd c:/cygwin/usr/share/site-lisp/
diff -u -b "c:/cygwin/usr/share/site-lisp/nnweb.el~" "c:/cygwin/usr/share/site-lisp/nnweb.el"
--- c:/cygwin/usr/share/site-lisp/nnweb.el~	Tue Jun  4 15:55:46 2002
+++ c:/cygwin/usr/share/site-lisp/nnweb.el	Wed Jun  5 15:59:06 2002
@@ -407,12 +407,23 @@
     (set-buffer nnweb-buffer)
     (erase-buffer)
     (when (funcall (nnweb-definition 'search) nnweb-search)
-	(let ((more t))
+	(let ((more t)
+	      (i 0))
 	  (while more
 	    (setq nnweb-articles
 		  (nconc nnweb-articles (nnweb-google-parse-1)))
-	    ;; FIXME: There is more.
-	    (setq more nil))
+	    ;; Check if there are more articles to fetch
+	    (goto-char (point-min))
+	    (incf i 100)
+	    (if (or (not (re-search-forward
+			  "<td nowrap><a href=\\([^>]+\\).*<span class=b>Next</span>" nil t))
+		    (>= i nnweb-max-hits))
+		(setq more nil)
+	      ;; Yup, there are more articles
+	      (setq more (concat "http://groups.google.com" (match-string 1)))
+	    (when more
+	      (erase-buffer)
+	      (mm-url-insert more))))
 	  ;; Return the articles in the right order.
 	  (setq nnweb-articles
 		(sort nnweb-articles 'car-less-than-car))))))

Diff finished at Wed Jun 05 15:59:12

[-- Attachment #3: Type: text/plain, Size: 10 bytes --]



Niklas


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Get more results from google searches in nnweb.el
  2002-06-05 14:05 [PATCH] Get more results from google searches in nnweb.el Niklas Morberg
@ 2002-06-11 19:55 ` Simon Josefsson
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Josefsson @ 2002-06-11 19:55 UTC (permalink / raw)
  Cc: ding

Niklas Morberg <niklas.morberg@axis.com> writes:

> Here's a patch that honors the value of nnweb-max-hits.
> Currently, you only get the first 100 results from google,
> but this patch should fix that.

Thanks, I added this.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-11 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-05 14:05 [PATCH] Get more results from google searches in nnweb.el Niklas Morberg
2002-06-11 19:55 ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).