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

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Thank you ig. Here is my stuff:
#!/usr/bin/perl -- use strict; use warnings; use LWP::Simple; my $saints = get('http://perlmonks.org/?node=Saints%20in%20our%20Book' +) or die "Can't get saints list\n"; # a hash of something like ( 'Cardinal (24)' => [9073, 381608], ... ) my %levels = ( 'HighPriority (00)' => [ # users to be highlighted 116292, # mpeppler 679041, # oshalla 222593, # ccn ], ); push @{$levels{$2}}, $1 while $saints =~ m{user-(\d+).+?<td>(\w+ \(\d+)\)</td>}g; print <<'End_of_FreeNodelet_part_1'; [id://492700|Free Nodelet] <!-- Highlight monk names accordingly their XP level see http://perlmonks.org/?node_id=752253 for comments --> <style type="text/css"> .Pope { font-weight: bold; color: #01C2F3 !important; } .Saint { font-weight: bold; color: #F400B1 !important; } .Sage { font-weight: bold; color: #F400B1 !important; } .Cardinal { font-weight: bold; color: #F400B1 !important; } .Archbishop { font-weight: bold; color: #F400B1 !important; } .Bishop { font-weight: bold; color: #F400B1 !important; } .Chancellor { font-weight: bold; color: #FF8000 !important; } .Canon { font-weight: bold; color: #FF8000 !important; } .Abbot { font-weight: bold; color: #FF8000 !important; } .Monsignor { font-weight: bold; color: #BA4D73 !important; } .Prior { font-weight: bold; color: #BA4D73 !important; } .Parson { font-weight: bold; color: #BA4D73 !important; } .Vicar { font-weight: bold; color: #51AE5A !important; } .Priest { font-weight: bold; color: #51AE5A !important; } .Curate { font-weight: bold; color: #51AE5A !important; } .HighPriority { font-weight: bold; background-color: #FFFF00 !importan +t; } </style> <script type="text/javascript"> <!-- // "When a society has no colored pants to differentiate class... // ...it's a society without purpose" -- Wef // http://en.wikipedia.org/wiki/Kin-dza-dza! var SaintsBook = new Object(); End_of_FreeNodelet_part_1 for my $ra (sort {$b->[2] cmp $a->[2]} map {[$_, split / /, $_]} keys +%levels) { # $ra looks like ['Cardinal (24)', 'Cardinal', '(24)'] print "var $ra->[1] = [", join(', ', @{$levels{$ra->[0]}}), "];\n" +; print "for( var i=$ra->[1].length-1; i>=0; i--) SaintsBook[$ra->[1 +]\[i]] = '$ra->[1]';\n\n"; } print <<'End_of_FreeNodelet_part_2'; function Colorize() { var links = document.links; for( var i=links.length-1; i>=0 ; --i ) if ( /node_id=(\d+)/.test(links[i].href) && SaintsBook[RegExp. +$1] ) links[i].className = SaintsBook[RegExp.$1]; } setTimeout('Colorize()', 600); // --> </script> <!-- End of Highlight monk names accordingly their XP level --> End_of_FreeNodelet_part_2 __END__
I'd like to make a cgi version of that script but I have no suitable public site to publish it.

In reply to Re^2: [Free Nodelet Hack] Highlight monk names accordingly their XP level by ccn
in thread [Free Nodelet Hack] Highlight monk names accordingly their XP level by ccn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (12)
    As of 2015-07-28 11:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (254 votes), past polls