Subject:
|
Re: Silly lugnet autoemailerator question...
|
Newsgroups:
|
lugnet.off-topic.geek
|
Date:
|
Wed, 9 Jan 2002 13:47:17 GMT
|
Viewed:
|
176 times
|
| |
| |
In lugnet.off-topic.geek, John D. Forinash wrote:
> In article <a1gj6c$2pq$1@localhost.localdomain>,
> J.D. Forinash <foxtrot@cc.gatech.edu> wrote:
> > Something that just goes down and over the right distance and puts an
> > X in is trivial, but I was thinking of what happens when the message
> > changes and down and over the right distance is no longer the right
> > place...
>
> (speaking of which, the way to do simply that is to toss)
>
> map ` 1G8j9lrXZZ
heh, that would work, assuming nothing changes :) you still need to hit
'y' in mutt though to send it out...
I'll attach my perlscript... first, you set up mutt so:
macro pager A
<pipe-message>/home/dan/bin/lugnetauth.pl^M<delete-message>
so that hitting 'A' in the pager (after making sure your message is what
you wrote!) will authorize and delete the message.
(adjust the path to lugnetauth.pl, of course).
here's the script:
#!/usr/bin/perl -w
# Dan Boger <lugnetauth@peeron.com>
# 06/19/01
#
# This script will accept the post authorization message from Lugnet
# (http://www.lugnet.com) and authorize them. It does not output
# anything, except to it's logfile ($log). Please DO NOT use this as an
# autoreply filter, since it'll break the whole reasoning for having
# authorization messages. Best use: bind it to a macro/key in your MUA,
# so when you recieve a message, you can read it, and if you do decide
# to authorize it, you can run the script on it.
use LWP::UserAgent;
my $ua = new LWP::UserAgent; my $KEY; my $req; my
$log="$ENV{HOME}/.lugnetauth.log"; #my $log="/dev/null";
while (<>) { next until
m!^\s+http://news.lugnet.com/news/post/auth/\?(\S*)!; $KEY = $1; last; }
die "No auth key found in message.\n" unless $KEY;
fork && exit;
$req = new HTTP::Request POST =>
"http://news.lugnet.com/news/post/auth/";
$req->content_type('application/x-www-form-urlencoded');
$req->content("KEY=$KEY\&CMD_APPROVE=Post+It");
my $res = $ua->request($req);
open (LOG, ">>$log") or die;
unless ($res->is_success) { print LOG "$KEY auth - request
failed.\n"; die; }
if ($res->content() =~ /Message successfully posted./) { print LOG "$KEY
auth - ok.\n"; exit; } elsif ($res->content() =~ /You have already
posted this message/) { print LOG "$KEY auth - dup: Already posted.\n";
} elsif ($res->content() =~ /Message does not exist/) { print LOG "$KEY
auth - fail: No such message.\n"; }
close LOG;
please, use responsibly :)
Dan
|
|
Message has 1 Reply: | | Re: Silly lugnet autoemailerator question...
|
| (...) Indeed. Hm. (...) Ah, I completely forgot you could do this. (...) Oh, certainly. I'm just trying to cut down on the annoyance of the autoemailerator. I suspect it's notably less annoying for folks who just point the mouse and type X, and I (...) (23 years ago, 10-Jan-02, to lugnet.off-topic.geek)
|
Message is in Reply To:
| | Re: Silly lugnet autoemailerator question...
|
| (...) (speaking of which, the way to do simply that is to toss) map ` 1G8j9lrXZZ in your .exrc Then when you hit the ` key in beep mode, it'll go toss the X in the right place and save, from where you tell your MUA to send it. It does not, as (...) (23 years ago, 9-Jan-02, to lugnet.off-topic.geek)
|
13 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|