Jump to content

User:Heb/PDSBA.pl

From Wikipedia, the free encyclopedia

#!/usr/bin/perl -w

use strict;

my $weekbegin=1;
my $weekend=52;
my $year=2008;
my @otheryears = (2006,2007,2008);


my $header = qq{==[[Portal:Denmark|Denmark Portal]] selected biography archive: $year ==
This is the selected biography archive, for the [[Portal:Denmark|Denmark portal]].

};

my $footer = q{<small>This index is generated by [[User:Hebster/PDSBA.pl|this cruel]] but working [[Perl|perl-script]].</small>
};

################

print $header;

foreach my $otheryear (@otheryears) {
  if ($otheryear != $year) {
     print "* [[Portal:Denmark/Selected biography/Archive/$otheryear|Year $otheryear archive]]\n";
  }
}

print "\n\n";

while ($weekbegin <= $weekend) {
  print "'''$weekbegin:''' <small><span class=\"plainlinks\">[[Portal:Denmark/Selected biography/$year/$weekbegin|View]] {{·}} [http://en.wikipedia.org/w/index.php?title=Portal:Denmark/Selected_biography/$year/$weekbegin&action=edit edit] {{·}} [[Portal talk:Denmark/Selected biography/$year/$weekbegin|discuss]] {{·}} [http://en.wikipedia.org/w/index.php?title=Portal:Denmark/Selected_biography/$year/$weekbegin&action=history history]</span></small>\n";
  print "{{Portal:Denmark/Selected biography/$year/$weekbegin}}\n";
  print "----\n\n"; 

  $weekbegin++;
}

print $footer;