Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Creating a perlmonks node grabber

by httptech (Chaplain)
on May 04, 2000 at 16:44 UTC ( #10217=monkdiscuss: print w/replies, xml ) Need Help??

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("\%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 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?
RE: Creating a perlmonks node grabber
by vroom (Pope) 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 instead of

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://10217]
[james28909]: wish i could stay and chat. i have an unsuspecting client to give an estimate to. muhhahaha
[holli]: I really like these guys. Ugly, but hell of a flow.
[holli]: Quite good evidence immigrants can contribute to a countries culture.
LanX ... let me hear your body talk...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-12-13 18:14 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (373 votes). Check out past polls.