#!/usr/bin/perl -W use strict; #Gaim Theme Viewer - builds a HTML page to see the smileys from a Gaim theme #(C) 2003 John B. Silvestri - silvestrij@users.sourceforge.net #Created 18 January 2003 #Last modified 26 January 2003 # #Run this program from the folder containing the smileys #e.g. from ~/.gaim/smileys/exhaustive # #Licensed under the GNU GPL (http://www.gnu.org/licenses/gpl.txt) #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 2 of the License, or #(at your option) any later version. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. open(THEME,"theme") or die "No 'theme' file found, perhaps you are not in the desired theme's folder?\n"; open(OUT,">","index.html") or die "Cannot create index.html file: $!"; my ($name,$auth,$desc,$icon); for (my $i=0;$i<4;$i++){ my @keyval=split( /\=/, ); my $key=$keyval[0]; my $val=$keyval[1]; chomp $val; if ($key=~/Name/){$name=$val;} elsif ($key=~/Author/){$auth=$val;} elsif ($key=~/Description/){$desc=$val;} elsif ($key=~/Icon/){$icon=$val;} #For now, do nothing - wait for table version } print OUT "Gaim Theme Viewer - $name\n"; print OUT "

    $name

\n"; print OUT "

$desc

\n"; print OUT "

by $auth

\n"; LINEREAD: while(){ next LINEREAD if /^#/; next LINEREAD if /^\s*$/; if (/^\[(.*)\]\n$/){ print OUT "

$1

\n"; }else{ my @parts=split(/\s+/); my $img=shift @parts; if ($img eq "!"){ $img=shift @parts;} print OUT "    "; print OUT join "  ", @parts; print OUT "
\n"; } }#end LINEREAD print OUT "\n";