YOU CAN EDIT THIS PAGE! Just click any blue "Edit" link and start writing!

Difference between revisions of "User:Elgaard"

From Wikitravel
Jump to: navigation, search
(Places I have been and contributed to Wikitravel)
(Places I have been and contributed to Wikitravel)
Line 21: Line 21:
  
 
* [[Denmark]] where I live
 
* [[Denmark]] where I live
* [[Italy]] from [[Rome]] to [[Napoli]]
+
* [[Italy]] from [[Rome]] to [[Napoli]], [[Stia]], [[Montepulciano]], [[Pienza]], [[Casentino]], [[Castiglion Fiorentino]]
 
* [[Egypt]]: [[Cairo]]
 
* [[Egypt]]: [[Cairo]]
 
* [[Brazil]]: [[Rio de Janeiro]], [[Sao Paulo]], [[Santos]], [[Paraty]]
 
* [[Brazil]]: [[Rio de Janeiro]], [[Sao Paulo]], [[Santos]], [[Paraty]]
Line 46: Line 46:
 
* [[Switzerland]]: [[Geneva]]
 
* [[Switzerland]]: [[Geneva]]
 
* [[Portugal]]: [[Lissabon]], [[Porto]], [[Sintra]], [[Coimbra]]
 
* [[Portugal]]: [[Lissabon]], [[Porto]], [[Sintra]], [[Coimbra]]
* [[Spain]]: Salamanca
+
* [[Spain]]: [[Barcelona]], [[Salamanca]]
 
* [[Norway]]: [[Oslo]]
 
* [[Norway]]: [[Oslo]]
 
* [[Chile]]:  
 
* [[Chile]]:  
 
* [[Argentina]]: [[Buenos Aires]], [[Salta]]
 
* [[Argentina]]: [[Buenos Aires]], [[Salta]]
* [[Brazil]]: [[Sao Paolo]], [[Paraty]]
 
 
* [[Gambia]] : [[Banjul]]
 
* [[Gambia]] : [[Banjul]]
 
* [[Thailand]]: [[Chiang Mai]],[[Chiang Rai]]
 
* [[Thailand]]: [[Chiang Mai]],[[Chiang Rai]]
 +
* [[China]]: [[Shanghai]], [[Hong Kong]], [[Macao]]
 +
* [[Greenland]]: [[Nuuk]], [[Kangerlussuaq]]
  
 
==Wikitravel as book==
 
==Wikitravel as book==

Revision as of 21:00, 11 July 2012

Niels Elgaard Larsen, Østerbro, Copenhagen, Denmark

Me, in Tunis

Use of Pictures

Alle pictures on Wikitravel copyrighted by me are cc-sa/GFDL dual licensed.

About Me

agol homepage


Docent

If you want to contact me, email:

 elgaard <at> agol.dk


Places I have been and contributed to Wikitravel

Wikitravel as book

I managed to make an automatic Wikitravel book for all of Italy. There is still a lot on the TODO list, but my plane leaves in 9 hours, so I better stop now :-)

It is based on User:Mark's mvs and html2ps.

The script is (I changed it to do only Rome by default):

#!/usr/bin/perl

# wtbook

#(c) 2005, Niels Elgaard Larsen
# Licence: GPL

#TODO:
 #  Handle dead links
 # Unicode
 # info box
 # make html2ps xrefs work.

$initDest="Rome";
#$initDest="Italy";
my @newdests = ($initDest);
my @donedests = ( );

#my @sorted    = sort @animals;

sub destin {
  my $ldst = shift(@_);
  $ldst =~ s/ /_/ge;
  $ldst =~ s/\'/%27/ge;
##  print "ins $ldst EE [email protected]_ \n";
  foreach $de (@donedests) {
    if ($de eq $ldst) {
      return;
    }
  }

  foreach $de (@newdests) {
    if ($de eq $ldst) {
      return;
    }
  }
    push @newdests, $ldst;
}


while ($dst=pop(@newdests)) {
  print "Doing $dst.wiki\n";
  $getwiki = system("mvs update $dst.wiki");
  $er=open(WF, "$dst.wiki");
  #print "GW = $getwiki er= $er \n";
  
  ## TODO Other Destinations
  #for Districs Regions
  while (<WF>) {
    if (/== *(|Regions|Cities|Districts) *==/i ) {
      print DIST;
      last;
    }
    print x1 $_;
  }
  
  while (<WF>) {
    if (/\*\[\[([^\]\|]*)/i) {
      #    print "stjYY $1 d2 $2 XX $_\n";
      print "$1\n";
      destin($1);
      next;
    }
    if ( /^==/ ) {
      last;
    }
  }
  close(WF);
  push @donedests, $dst;
}
print "\ndonedests= @donedests\n";
print "newdests= @newdests\n";
#### Print it 


# wt2ps is a modified html2ps, hacked to do extra CSS2 tags (like the printing SS) and a few unicodes (euro), fixed /table bug
$dno = 0;

$dlist = "";

foreach $de (@donedests) {
  $dno = $dno +1;
  $dnos = sprintf ("%03d",$dno);
  $of =  "P$dnos$de.ps";
  $of =~ s/\//D/ge;
  if (system("ls $de.wiki")) {
    print "Err $de dead\n";
  } else {
    print "converting to PS http://wikitravel.org/en/$de to P$dnos$de.ps\n";
    $dlist = $dlist . " http://wikitravel.org/en/$de "
  }
}
print "Destination list is $dlist";
system("wt2ps -D --number  --output $initDest.ps --duplex 1 -H $dlist ");

My modified html2ps i call User:Elgaard/wt2ps User:Elgaard//mvfoo

Sandbox