Mancala Games /Pagina Inicial

0. Tenim un treuhtml.pl tal que:

 #!/usr/bin/perl
 open (ENTRADA , "< @ARGV[0] ");
 $imprimir = 0;
 foreach $linia ( <ENTRADA> )
  {
   if ( $linia =~ "<!-- Begin browse -->")
   {
    $imprimir = 1;
   }
  elsif ( $linia =~ "<div id=\"actionbar\" class=\"toolbar\">")
    {
     $imprimir = 0;
    }
   elsif ($imprimir == 1)
    {
     printf ($linia);
    }
  }
 close ENTRADA;

00. Tenim un script repassa.sh que diu:

 #!/bin/bash
 cd www.manqala.org/wiki/index.php/MancalaGames
 rm -f PaginaInicial*
 echo "<Html>\n<Title>Mancala Games</Title>\n<Body>\n" treuhtml.pl ../MancalaGames*html

echo "\n<HR>\n" oldIFS=$IFS IFS=$(echo -e "\n\r") for i in `ls *html` do

 treuhtml.pl $i
 echo "\n<HR>\n"

done IFS=$oldIFS echo "</Body>\n</Html>"

01. Executem

 #!/bin/bash
 wget -r -p -E -k -l 1 \
 http://www.manqala.org/wiki/index.php/MancalaGames/PaginaInicial
 repassa.sh > DocumentSencer
 sed s/0.000000/\?/g DocumentSencer | \
 sed "s/\&amp;/\&/g" > \   www.manqala.org/wiki/index.php/MancalaGames/DocumentSencer
 cd www.manqala.org/wiki/index.php/
 ln -s ../themes/ .
 cd MancalaGames/
 html2ps -ngt -C bh  DocumentSencer > ../../../../1.ps
 cd -
 ps2ps 1.ps n.ps
 psbook n.ps bn.ps
 pstops "2:0L@.7(21cm,0cm)+1L@.7(21cm,14.85cm)" bn.ps n2.ps
 pstops "4:3L@.7(21cm,0cm)+0L@.7(21cm,14.85cm),1L@.7(21cm,0cm)+2L@.66(21cm,14.85cm)" n2.ps n4.ps
 ps2pdf 1.ps a4.pdf
 ps2pdf n2.ps a5booklet.pdf
 ps2pdf n4.ps a6booklet.pdf
 rm -rf *.ps
 rm -rf www.manqala.org

Last edited on March 18, 2005 5:52 pm.