Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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...

Comment on Creating a perlmonks node grabber
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 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 (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 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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://10217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2014-09-22 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (178 votes), past polls