From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45118 Path: main.gmane.org!not-for-mail From: Niklas Morberg Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Get more results from google searches in nnweb.el Date: Wed, 05 Jun 2002 16:05:18 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1023285792 22091 127.0.0.1 (5 Jun 2002 14:03:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2002 14:03:12 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17FbNX-0005kC-00 for ; Wed, 05 Jun 2002 16:03:11 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17FbMY-0006rs-00; Wed, 05 Jun 2002 09:02:10 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 05 Jun 2002 09:02:26 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id JAA05103 for ; Wed, 5 Jun 2002 09:02:16 -0500 (CDT) Original-Received: (qmail 7756 invoked by alias); 5 Jun 2002 14:01:55 -0000 Original-Received: (qmail 7751 invoked from network); 5 Jun 2002 14:01:54 -0000 Original-Received: from krynn.axis.se (193.13.178.10) by gnus.org with SMTP; 5 Jun 2002 14:01:54 -0000 Original-Received: from PCNIKLAS2 (dh10-13-8-243.axis.se [10.13.8.243]) by krynn.axis.se (8.12.2/8.12.2/Debian -5) with ESMTP id g55E1RS3027263 for ; Wed, 5 Jun 2002 16:01:27 +0200 Original-To: ding@gnus.org Original-Lines: 14 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-mingw-nt5.0.2195) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45118 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45118 --=-=-= (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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnweb.el.diff 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 + "]+\\).*Next" 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 --=-=-= Niklas --=-=-=--