<?xml version="1.0" encoding="windows-1252"?>
<node id="10256" title="Dark Theme for /. through Perl" created="2000-05-04 19:07:08" updated="2005-08-15 08:38:45">
<type id="1748">
sourcecode</type>
<author id="5272">
PipTigger</author>
<data>
<field name="doctext">
&lt;code&gt;
#!/usr/bin/perl

#use CGI ":standard";
use LWP::Simple;

my $this = "http://your.servers.url/yourpath/whatyounamedthis.cgi";
my $meth = $ENV{'REQUEST_METHOD'};
my $quer = $ENV{'QUERY_STRING'};
#my $surl = "http://www.slashdot.org";
my $surl = "";
if ($quer &amp;&amp; $meth eq "GET") { $surl = $quer; }
if ($surl =~ /slashdot\.org/) {
    $surl =~ s!slashdot\.org/articles/(\d\d)/(\d\d)/(\d\d)/(\d+)\.shtml!slashdot.org/article.pl?sid=$1/$2/$3/$4&amp;cid=&amp;pid=0&amp;startat=&amp;threshold=2&amp;mode=thread&amp;commentsort=3!i; 
    $surl =~ s!slashdot\.org/interviews/(\d\d)/(\d\d)/(\d\d)/(\d+)\.shtml!slashdot.org/comments.pl?sid=$1%2F$2%2F$3%2F$4&amp;cid=&amp;pid=0&amp;startat=&amp;threshold=2&amp;mode=thread&amp;commentsort=3!i; 
}
my $site = get $surl; 

print "Content-type: text/html\n\n";

$site =~ s/&lt;title&gt;/&lt;title&gt;*pc* /i;
if ($surl =~ /slashdot\.org/i) {
  if ($surl !~ /org\/askslashdot/i) {
    $site =~ s/&lt;BODY bgcolor="#000000" text="#000000" link="#006666" vlink="#000000"&gt;/&lt;BODY bgcolor="#000001" text="#4FFFAF" link="#00BBBB" vlink="#4F2F9F"&gt;/;
    $site =~ s/&lt;FONT color="#000000"&gt;/&lt;FONT color="#A8F8F0"&gt;/g;
    $site =~ s/bgcolor="#006666"&gt;&lt;IMG/bgcolor="#004444"&gt;&lt;IMG/g;
    $site =~ s/CCCCCC"&gt;&lt;FONT color="#000000" size=2&gt;/CCCCCC"&gt;&lt;FONT color="#B0D0F0" size=2&gt;/g;
    $site =~ s/&lt;B&gt;Results&lt;\/B&gt;/&lt;B&gt;&lt;font color="#00BBBB"&gt;Results&lt;\/font&gt;&lt;\/B&gt;/g;
    $site =~ s/&amp;mode=thread&gt;(.*)&lt;\/A&gt;/&amp;mode=thread&gt;&lt;font color="#00BBBB"&gt;$1&lt;\/font&gt;&lt;\/A&gt;/g;
    $site =~ s/www\.thinkgeek\.com&gt;ThinkGeek&lt;\/A&gt;/www\.thinkgeek\.com&gt;&lt;font color="#00BBBB"&gt;ThinkGeek&lt;\/font&gt;&lt;\/A&gt;/g;
    $site =~ s/    &lt;FONT size=2 face="arial,helvetica"&gt;&lt;I&gt;/    &lt;FONT color="#F0F0A0" size=2 face="arial,helvetica"&gt;&lt;I&gt;/g;
    $site =~ s/Andover\.Net"&gt;Andover\.Net&lt;\/A&gt;/Andover\.Net"&gt;&lt;FONT size=1 color="#009999" face="arial,helvetica"&gt;Andover\.Net&lt;\/font&gt;&lt;\/A&gt;/g;
    $site =~ s/size=3 color="#006666"/size=3 color="#00BBBB"/g;
    $site =~ s/size=1 color="#006666"/size=1 color="#00BBBB"/g;
    $site =~ s/size=4 color="#FFFFFF"/size=4 color="#DEFEEE"/g;
    $site =~ s/&lt;FONT COLOR="#FFFFFF"&gt;/&lt;FONT COLOR="#CEFEEE"&gt;/g;
    $site =~ s/"#006666"/"#004444"/g; #size=3||1 color=# -&gt; 00BBBB
    $site =~ s/"#FFFFFF"/"#000412"/g; #001204
    $site =~ s/&lt;TD bgcolor="#ffffff"/&lt;TD bgcolor="#120212"/;
    $site =~ s/bgcolor=cccccc&gt;/bgcolor="#521222"&gt;/g;
    $site =~ s/bgcolor=ffffff&gt;/bgcolor="#120212"&gt;/g;
    $site =~ s/"ffffff"/"120212"/g;
    $site =~ s/"#ffffff"/"#AECEFE"/g;
    $site =~ s/"#CCCCCC"/"#521222"/g; #321202
    $site =~ s/"#000000"/"#C0F0D0"/g; #B0D0F0 F0D0B0 D0FFEF
    $site =~ s!(&lt;a href=")(http://slashdot[^"]*?)("&gt;)!$1$this?$2$3!gi;
    $site =~ s!&lt;a href=http://slashdot\.org/([^&gt;]*)&gt;!&lt;a href="$this?http://slashdot.org/$1"&gt;!gi;
    $site =~ s!&lt;a href=/([^&gt;]*)&gt;!&lt;a href="$this?http://slashdot.org/$1"&gt;!gi;
#  } else {
    #ask/. stuff only
  }
} elsif ($surl =~ /opensales\.org/i) {
    $site =~ s!white!black!i;
    $site =~ s!bgcolor="#FFFFFF"!bgcolor="#000412"!i;
    $site =~ s!href="/([^"]*)"&gt;!href="$this?http://www.opensales.org/$1"&gt;!gi;
    $site =~ s!"/images!"http://www.opensales.org/images!gi;
} elsif ($surl =~ /hotmail\.com/i) {
    $site =~ s/#000000/#C0F0D0/g;
} else {
    print &lt;&lt;END_0;
&lt;html&gt;&lt;head&gt;&lt;title&gt;PipzColourz Index&lt;/title&gt;&lt;/head&gt;&lt;body bgcolor="#03070F"
text="#AEFEBE" link="#0000FF" vlink="#D000A0" alink="#FF0000"&gt;&lt;center&gt;
&lt;h1&gt;PCndx&lt;/h1&gt;&lt;br&gt;&lt;hr&gt;&lt;br&gt;
&lt;h3&gt;&lt;a href="$this?http://slashdot.org/"&gt;/. slashdot /.&lt;/a&gt;&lt;/h3&gt;
&lt;h3&gt;&lt;a href="$this?http://www.opensales.org/"&gt;opensales&lt;/a&gt;&lt;/h3&gt;
&lt;h3&gt;&lt;a href="http://hotmail.com/"&gt;hotmail&lt;/a&gt;&lt;/h3&gt;
&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;
END_0
}
print $site;
&lt;/code&gt;
</field>
<field name="codedescription">
Here's a little script I wrote for myself since I like light text on dark backgrounds (thanks again for the nice PerlMonks theme Vroom!) and /. doesn't have one... I know it's pretty suckie and could be a lot simpler.  If you can make it better, please email it to me (piptigger@dimensionsoftware.com) as I use it everyday now.  It doesn't werk yet for the ask/. section but when I find some time, I'll add that too.  I hope someone else finds this useful.  TTFN &amp; Shalom.&lt;br&gt;&lt;br&gt;

-PipTigger&lt;br&gt;
p.s. I tried to submit this to the CUFP section but it didn't work so I thought I'd try here before giving up.  Please put the script on your own server and change the $this to reflect your locale.  Thanks!</field>
<field name="codecategory">
CUFP</field>
<field name="codeauthor">
PipTigger&lt;br&gt;
piptigger@dimensionsoftware.com</field>
</data>
</node>
