http://www.perlmonks.org?node_id=10217

I'm brainstorming on how to create a perlmonks node grabber. Since you can download nodes in sequential order, it shouldn't be too hard to just request a set of numbers until you hit a "Not Found", and then display the last 10 or so.

However, I don't want to create so much useless traffic on the site, essentially stabbing in the dark to find out what the last node is. I'm trying to figure out a way to figure out the latest node quickly and efficiently. Anyone got any ideas?

Or, Vroom, you could add a perlmonks.xml backend to the site that could be slurped every 30 minutes by the more obsessed monks...

Replies are listed 'Best First'.
RE: Creating a perlmonks node grabber
by httptech (Chaplain) on May 04, 2000 at 17:17 UTC
    Ok, here's my code for this. This displays the newest 10 nodes. From here it's easy to cut and paste this into my Slashdot Headline Grabber or create a Perl/Tk,Perl/Gtk or Perl/Qt app to do the same thing.
    use LWP::Simple; my $slurp = get("http://www.perlmonks.org/index.pl?node=Newest\%20Node +s"); push @nodes, $1 while $slurp =~ /\?node_id=(\d+)\&/g; print join("\n", (reverse sort {$a <=> $b} @nodes)[0..9]);
      This seemed more appropriate to the snippets section, so I added it there as well.
RE: Creating a perlmonks node grabber
by vroom (His Eminence) on May 04, 2000 at 22:30 UTC
      I've rewritten this in the snippets section to use headlines.rdf now.
        That last post was from me; I accidentally logged myself out by using perlmonks.org instead of www.perlmonks.org.

        Another great reason to use user-defined stylesheets, so you can tell immediately if you're logged in or not :)

RE: Creating a perlmonks node grabber
by httptech (Chaplain) on May 04, 2000 at 16:59 UTC
    Well, I answered my own question by digging around a bit more and finding the "Newest Nodes" node. Is this new, or did I just miss it before?