From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23032 Path: main.gmane.org!not-for-mail From: pahe@daimi.au.dk (Peter von der =?iso-8859-1?q?Ah=E9?=) Newsgroups: gmane.emacs.gnus.general Subject: nndoc types for freshmeat newsletters Date: 23 May 1999 20:38:56 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035160842 32350 80.91.224.250 (21 Oct 2002 00:40:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:40:42 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA09983 for ; Sun, 23 May 1999 14:39:48 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAB20796; Sun, 23 May 1999 13:39:40 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 23 May 1999 13:40:04 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA16707 for ; Sun, 23 May 1999 13:39:54 -0500 (CDT) Original-Received: from ufleku.daimi.au.dk (pahe@ufleku.daimi.au.dk [130.225.19.182]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA09967 for ; Sun, 23 May 1999 14:39:01 -0400 (EDT) Original-Received: (from pahe@localhost) by ufleku.daimi.au.dk (8.9.3/8.8.4) id UAA22831; Sun, 23 May 1999 20:38:56 +0200 Original-To: ding@gnus.org X-Attribution: Ahe Original-Lines: 15 User-Agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:23032 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23032 --=-=-= Hi! I have created a nndoc type for freshmeat newsletters. I would like to be able to use adaptive scoring on the results, so gnus can help me decide which freshmeat articles I would like to read. Any ideas on how to use adaptive scoring with a nndoc group? I have attached the code here with the apropriate GPL statements, so feel free to use it for whatever you like. Cheers, Peter --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=20-nndoc-freshmeat.el Content-Transfer-Encoding: 8bit Content-Description: dissect freshmeat newsletters ;;; nndoc-freshmeat.el -- dissect freshmeat newsletters ;; Copyright (C) 1999 Peter von der Ahé ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (require 'nndoc) (setq nndoc-freshmeat-delim "\n *--- - --- ------ - --- -- - - - -- -\n\n") (nndoc-add-type `(freshmeat (first-article . "^ \\[ article details \\]\n\n") (article-begin . ,nndoc-freshmeat-delim) (file-end . "\nthat's it for today") (generate-head-function . nndoc-freshmeat-parts-head) (prepare-body-function . nndoc-freshmeat-strip-delim)) 'first) (defun nndoc-freshmeat-strip-delim () (while (re-search-forward nndoc-freshmeat-delim nil t) (replace-match ""))) (defun nndoc-freshmeat-type-p () (when (re-search-forward "^subject: \\[fm/news\\]" nil t) t)) ;; Derived from nndoc-generate-clari-briefs-head (defun nndoc-freshmeat-parts-head (article) (let ((entry (cdr (assq article nndoc-dissection-alist))) subject from date) (save-excursion (set-buffer nndoc-current-buffer) (save-restriction (narrow-to-region (car entry) (nth 3 entry)) (goto-char (point-min)) (when (looking-at "^ *subject: \\(.*\\)$") (setq subject (match-string 1))) (when (and (equal (forward-line 1) 0) (looking-at "^ *added by: \\(.*\\) on \\(\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\).*\\)$")) (setq from (match-string 1) date (match-string 2))))) (insert "From: freshd@freshmeat.net (" (or from "unknown") ")" (when date "\nDate: " date) "\nSubject: " (or subject "(no subject)")))) --=-=-=--