From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/51489 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: How many people mark spam in gmane groups? Date: Tue, 15 Apr 2003 15:33:13 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4nvfxfa746.fsf@lockgroove.bwh.harvard.edu> References: <4n4r5aowwm.fsf@chubby.bwh.harvard.edu> <87llyfsoi6.fsf@eris.void.at> <877k9y1x96.fsf@eris.void.at> <4nvfxgri1d.fsf@lockgroove.bwh.harvard.edu> <8765pgjpc9.fsf@doohan.bang.priv.no> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050435244 13505 80.91.224.249 (15 Apr 2003 19:34:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 15 Apr 2003 19:34:04 +0000 (UTC) Original-X-From: ding-owner+M33@lists.math.uh.edu Tue Apr 15 21:34:00 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 195WBC-0003R3-00 for ; Tue, 15 Apr 2003 21:33:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 195WBJ-0002En-00; Tue, 15 Apr 2003 14:33:25 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 195WBC-0002Eh-00 for ding@lists.math.uh.edu; Tue, 15 Apr 2003 14:33:18 -0500 Original-Received: (qmail 21775 invoked by alias); 15 Apr 2003 19:33:15 -0000 Original-Received: (qmail 21770 invoked from network); 15 Apr 2003 19:33:15 -0000 Original-Received: from clifford.bwh.harvard.edu (134.174.9.41) by sclp3.sclp.com with SMTP; 15 Apr 2003 19:33:15 -0000 Original-Received: from lockgroove.bwh.harvard.edu (lockgroove [134.174.9.133]) by clifford.bwh.harvard.edu (8.10.2+Sun/8.11.0) with ESMTP id h3FJXDI00630 for ; Tue, 15 Apr 2003 15:33:13 -0400 (EDT) Original-Received: (from tzz@localhost) by lockgroove.bwh.harvard.edu (8.11.6+Sun/8.11.0) id h3FJXDt06265; Tue, 15 Apr 2003 15:33:13 -0400 (EDT) Original-To: ding@gnus.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: ding@gnus.org In-Reply-To: <8765pgjpc9.fsf@doohan.bang.priv.no> (Steinar Bang's message of "Tue, 15 Apr 2003 07:34:46 +0200") User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (usg-unix-v) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:51489 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:51489 On Tue, 15 Apr 2003, sb@dod.no wrote: > (defun gmane-gnus-summary-report-spam () > "Report gmane spam." > (interactive) > (browse-url > (format "http://spam.gmane.org/%s:%d" > (gnus-group-real-name gnus-newsgroup-name) > (gnus-summary-article-number)))) Since browse-url is fairly slow and tends to require interactivity, and we need a fast write-only URL ping, I put together the following code out of net-utils.el: (progn (with-temp-buffer (let ((host "spam.gmane.org")) (or (setq tcp-connection (open-network-stream "URL ping" (buffer-name) host 80)) (error "Could not open connection to %s" host)) (set-marker (process-mark tcp-connection) (point-min)) (set-process-filter tcp-connection 'net-utils-remove-ctrl-m-filter) (process-send-string tcp-connection (format "GET /gmane.emacs.help:8479 HTTP/1.1\nHost: spam.gmane.org\n\n"))))) (the article in the code above was real spam, btw) It seems correct to me. Since the temp-buffer gets killed, that will kill the network connection as well, right? If people like this, I will use it instead of the browse-url/url-retrieve functions in spam-report.el. spam-report.el is almost ready except for this detail. Ted