From: jidanni@jidanni.org
To: gmane-discuss@hawk.netfonds.no
Cc: ding@gnus.org
Subject: gmane_link -- extract some URLs to a gmane article
Date: Sun, 18 Jan 2009 05:50:19 +0800 [thread overview]
Message-ID: <87ocy5d2lg.fsf@jidanni.org> (raw)
In-Reply-To: <87hc424lwh.fsf@jidanni.org>
#!/usr/bin/perl
# Gentlemen, as you know on Gmane some articles, e.g.,
# http://article.gmane.org/gmane.org.wikimedia.mediawiki.api/873/raw
# lack the Archived-At: <http://permalink.gmane.org/gmane.org.wikimedia.mediawiki.api/873>
# header, even though that URL very much exists.
# That's where I step in. My masterfully crafted script below extracts
# the pertinent substitute links. Whilst not total "breast
# reconstruction" for the damaged article, at least the two substitute
# URLs should mean no more groping for the right links to tell your
# friends.
# In fact we print all the Gmane links for the article possible to
# compute offline we can, including those computed from any
# Archived-At header actually present.
# One might ask "why not fix the damage at the source?" Well it's
# attitudes like that lead to long unemployment lines!
# gmane_link -- extract some URLs to a gmane article fed in on stdin
# Copyright : http://www.fsf.org/copyleft/gpl.html
# Author : http://jidanni.org/
# Created On : Sun Jan 18 04:24:07 2009
# Last Modified On: Sun Jan 18 05:48:58 2009
# Update Count : 41
use strict;
use warnings FATAL => 'all';
while (<>) {
if (/^Message-ID: <(.*)>/) {
print <<EOF;
http://mid.gmane.org/$1
http://news.gmane.org/find-root.php?message_id=$1
EOF
}
elsif (/^Archived-At: <(.*)>/) {
$_ = $1;
print "$_\n";
s/permalink(?=\.gmane)/article/ or die 'Not Gmane?';
print "$_\n";
s@$@/raw@;
print "$_\n";
}
elsif (/^$/) { exit; }
}
parent reply other threads:[~2009-01-17 21:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <87hc424lwh.fsf@jidanni.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocy5d2lg.fsf@jidanni.org \
--to=jidanni@jidanni.org \
--cc=ding@gnus.org \
--cc=gmane-discuss@hawk.netfonds.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).