Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I'm on dialup, and don't want to eat merlyns bandwidth, so, here's a little hack entitled

MTV Cache

#!C:/perl/bin/perl -w # generates an mtv cache use strict; my @oops = qw(10 13 28 38 48 55); # columns with double code listings my $mtv = 'perl -T mtv.pl '; my $dat = 'index.dat'; # make sure they match my %dex; $|=1; print "Binding Index\n"; `$mtv action=bindex`; print "reading $dat\n"; open(FILE,"< $dat") or die "$!"; my @dat = <FILE>; close(FILE) or die "$!"; print "generating list\n"; for(@dat) { my($num,$desc)=split(/\t/); chomp $desc; $dex{$num}= $desc; } undef @dat; print "deleting chokers\n"; for(@oops) { delete $dex{$_}; } undef @oops; print "building mtv.cache.index.html\n"; open(OUTFH, '> mtv.cache.index.html') or die $!; print OUTFH q~ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>M +TV</title> </head><body text="black" bgcolor="white"><blockquote /><h1>MTV Cache< +/h1>~; for my $key (sort keys %dex) { open(OUTFH2, '> '."$key.mtvcol.html") or die "$key.mtvcol.html $!\ +n"; print "generating $key.mtvcol.html\n"; print OUTFH2 `$mtv getdoc=$key action=view`; close OUTFH2; print OUTFH '<a href="'."$key.mtvcol.html".'"'.">$key.$dex{$key}</ +a><BR>\n"; } print OUTFH q~</body></html>~; close OUTFH;exit; __END__ =head1 DESCRIPTION Just a dirty little script i hacked together in a few minutes, borrowing heavily from mtv. It should work regardless of platform. And it'll take down the server load. Currently, since i'm just capturing the output of mtv.pl, the http header is not stripped. It is kind of refreshing to be greeted by Content-Type: text/html; charset=ISO-8859-1 It is a "commandline" script, as if you couldn't tell.

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


In reply to (crazyinsomniac) Re: MTV by crazyinsomniac
in thread MTV by epoptai

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
  • Outside of code tags, you may need to use entities for some characters:
            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 browsing the Monastery: (12)
    As of 2014-12-19 20:13 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (91 votes), past polls