Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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...

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 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 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?
[moritz]: seems there's a size limit for hostenum, and the error message just sucks
[vrk]: None, other than the location of the error: auto/NetAddr/IP/ _splitref.al
[vrk]: Aha, there's a reference to "bug report 82719" in NetAddr/IP.pm's sub _splitref.
[moritz]: wow, that's their idea of an "improved error message"
[moritz]: how about "This network is too large to enumerate all host addresses." or so?
[vrk]: Well, there's a call to notcontiguous() before the error, whose description is "counts the bit positions remaining in the mask when the rightmost '0's are removed"
[vrk]: Clear as mud!

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-04-25 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.