Hello. I wrote this script a few months ago - it is ugly and nasty and doesn't even grab the author's name. But it works ;) Just pipe the output to a file and load that file in your browser.
use LWP; use HTTP::Request::Common; use strict; use constant URL => 'http://perlmonks.org/index.pl'; $|++; my $node = shift; print "USAGE: $0 [node_id]\n" and exit unless $node; my $ua = LWP::UserAgent->new; $ua->agent('node_grabber/1.0 (' . $ua->agent .')'); my $request = POST(URL, Content => [ node_id => $node ] ); my $response = $ua->request($request) or die "can't download id $node" +; my $html = $response->content(); my ($date) = $html =~ /a>\s*on\s*([^<]+?)<\/font/i; my ($title) = $html =~ /<title>([^<]+)<\/title>/; my $chunk; my @ends = ( qr|<BR>\s*<hr\s*\/>|, qr|<BR>\s+<BR><font size=2><I>|, qr|<CENTER>\s+back to <A HREF="|, qr|<BR>go see more <A HREF="|, qr|<center><TABLE width=|, ); foreach (@ends) { ($chunk) = $html =~ /<INPUT type=hidden name=op value=vote>(.*)(?:$ +_)/ms; last if $chunk; } unless ($chunk) { ($chunk) = $html =~ /<!--\s+-->(.*)(?:<!--\s+-->)/ms; } print "couldn't parse it :(\n" and exit unless $chunk; print "$title [$date]\n", $chunk;
I orginally tried to solve this problem with HTML::TokeParser but failed miserably. So, i just used some very fragile regexes instead. If anyone feels the need to improve this, then please be my guest. :)

P.S. an RSS feed that grabbed just a node sure would be nice. :)

UPDATE (April 2,2002): Kanji just /msg'ed me about displaytype=xml (i could have sworn that this was broken some time ago). This will make the above code not only overkill, but just plain silly. I'll be working on a replacement in the meantime this morning. And there it is below ---> ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: Reading PerlMonks offline by jeffa
in thread Reading PerlMonks offline by zjunior

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.