Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Most loved nodes

by gmax (Abbot)
on Mar 19, 2003 at 12:59 UTC ( #244322=CUFP: print w/ replies, xml ) Need Help??

background

There has been some discussion in the Monastery about the best nodes not being up to their name, meaning that there are several forgotten treasures that don't get the attention they deserve.

Here is a do-it-yourself alternative, obtained by taking the first 10 highest reputation nodes for each saint as of today.

Since it was generated automatically, according to a numerical criterium and depending on the limited space available, it could be debated whether this one is better or worse.

The attentive reader will notice that a few nodes in the best nodes are missing from this list, since they were produced by non-saints. Moreover, some of the nodes here might not be among the absolute best in PM. They are, however, the best nodes that each saint could produce, according to the other monks evaluation. So they should be worth a second glance.

At the very minimum, I believe that it is a good source of meditation upon the past experience at the Monastery.

First things first, here's the code to build this sort of super best nodes page.

Code

#!/usr/bin/perl -w use strict; use HTML::TreeBuilder; use LWP::Simple; sub get_most_voted ($); my $saints_html = get "http://www.perlmonks.org/index.pl?" . "node=saints%20in%20our%20book"; my $saints_tree = HTML::TreeBuilder->new_from_content($saints_html); my $table = $saints_tree->look_down('_tag' => 'table', 'width' => '70%'); my @rows = $table->look_down('_tag' => 'tr', sub {$_[0]->look_down('_tag' => 'td')->as_text !~ /^#$/}); for (@rows) { my ($rank, $name, $xp, $writeups, $level, $leveln) = $_->look_down('_tag','td'); printf "[%s] \n", $name->as_text; # printf "( XP %d, writeups %d)\n", $xp->as_text, $writeups->as_t +ext; my $wu = $writeups->as_HTML; $wu =~ s/createtime%20DESC/hr/; $wu =~ s/&amp;/&/g; my $address = "http://www.perlmonks.org"; if ($wu =~ /href="([^"]+)"/) { $address .= $1; $address .= "&length=10"; }; get_most_voted( $address ); } $saints_tree->delete; sub get_most_voted ($) { my $address = shift; my $nodes_page = get $address; my $nodes_tree = HTML::TreeBuilder->new_from_content($nodes_page); my $nodes_table = $nodes_tree->look_down('_tag' => 'table', 'id' => 'writeups'); my @writeups = $nodes_table->look_down('_tag' => 'tr', sub {$_[0]->look_down('_tag' => 'td')->as_text !~ /^Node ID$/} + ); print "<ul> "; for (@writeups) { my ($node_id, $node_title, $node_date) = $_->look_down('_tag' => 'td'); printf "<li>[id://%d]</li> ", $node_id->as_text; #printf "<!--%s--!>\n ", $node_title->as_text; } print "</ul>\n"; $nodes_tree->delete; };

Customization

You may customize this script according to your needs. For example, you could just pull the first 5 best nodes for each saint, or the best 20 for the first 35 saints only, and so on.

As for the specific method, I used HTML::TreeBuilder because I know the way it works and it's easy for me to think in terms of trees. Others may find this task easier to accomplish using other HTML::Parser cousins. I would be curious to see alternatives.

List

Then, the list of the most upvoted nodes for each saint.

vroom Ovid merlyn tilly dws tye chromatic jeffa japhy Zaxo davorg footpad Aristotle tachyon mirod blakem Masem grinder BrowserUk Abigail-II rob_au Juerd jcwren dragonchild crazyinsomniac demerphq John M. Dlugosz Corion perrin TStanley broquaint tadman chipmunk turnstep VSarkiss redcloud FoxtrotUniform dvergin btrott ybiC jepri Beatnik jmcnamara Erudil cjf boo_radley hsmyers Fastolfe MeowChow sauoq runrig jlongino andreychek gmax IlyaM arturo pg princepawn vladb JSchmitz shotgunefx larsen Adam rinceWind arhuman thraxil ignatz belg4mit ajt Dominus djw adrianh jplindstrom ichimunki arashi Kanji Mr. Muskrat George_Sherston Chmrr zdog jryan lhoward vek talexb grep lachoy theorbtwo ar0n Albannach PodMaster mdillon TheoPetersen cLive ;-) kudra danger lemming suaveant strat extremely busunsl Dog and Pony mojotoad RMGir jeroenes t0mas I0 Elian Fletch YuckFoo particle deprecated diotalevi atcroft shadox Petruchio KM bikeNomad jima stefp MZSanford frankus ariels OeufMayo kschwab Marza Biker jynx Dragonfly samtregar ChOas AgentM hotshot stephen BigJoe gryphon virtualsue neophyte clintp coreolyn Courage thatguy scottstef mrmick trs80 fever premchai21 valdez petdance thinker Jonathan clemburg azatoth little scain rbc jptxs Zoogie Ryszard petral derby robsv newrisedesigns DamnDirtyApe gav^ davis thelenm athomason tinman gornox_zx wil wog silent11 rdfield Chady
 _  _ _  _  
(_|| | |(_|><
 _|   

Comment on Most loved nodes
Download Code
Re: Most loved nodes
by shotgunefx (Parson) on Mar 19, 2003 at 15:30 UTC
    An interesting post++. I don't know if others feel this way but I find that majority of my 10 are by no means my more valuble posts. I've had some posts that I thought were interesting orcool that just went largely unnoticed. Another reason not to put too much stock in it.

    Not saying that there isn't value in the voting system, just that many variables outside of quality IMHO impact a post's score.

    -Lee

    "To be civilized is to deny one's nature."

      ++ to gmax for me, too.

      I agree with you, as I have the feeling that my best nodes are not on my top ten, too. I tried to analyze the phenomenon and wrote a meditation that, in my mind, could work as a tutorial for newbie monks. That was one of my more controversal nodes, on which I had a lot of votes, about an half were --; and it never reached meditations (it was moved to discussions). Aristotle, too, wrote a node on the meaning of XP and pointed me to it.

      From time to time monks come back and discuss about XP: XP is good, XP is bad, XP makes monks hungry, XP makes monks angry... my feeling is that XP makes the site alive. Why? Because it is good and bad, makes people hungry and angry and so on ;-)

      Ciao!
      --bronto


      The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
      --John M. Dlugosz
      This is quite expectable, actually. :) Think about it: the "best nodes", ie the highest voted nodes from all of the site don't highlight all the hidden treasures from all the authors we have. Why should that be any less true for the highest voted notes vs the hidden treasures written by any single author? Nevertheless, I think both facilities do have value. One should just be aware of the caveats, as always.

      Makeshifts last the longest.

Re: Most loved nodes
by Gavin (Canon) on Oct 18, 2007 at 18:47 UTC
    Really nice idea and a great node gmax
    There's some fantastic gems hidden there I intend to spend some time exploring.

    I'm going to run the code again to see how things have changed in the intervening four years!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://244322]
Approved by broquaint
Front-paged by jmcnamara
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-09-20 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (157 votes), past polls