my %projects;
-foreach my $year (qw/2010 2011 2012/) {
+foreach my $year (qw/2010 2011 2012 2013/) {
open LIST, "projects$year";
while (<LIST>) {
chomp;
my ($project, $url, $name);
open PAGE, $file;
while (<PAGE>) {
+ if (/Project name and homepage[:* ]*\[([^\[\]]*)\]\(([^()]*)\)/) {
+ $project = $1;
+ $url = $2;
+ }
if (/(Název projektu|Project name)[:* ]*(.*)/) {
- $project = $2;
+ if (!$project) {
+ $project = $2;
+ }
}
if (/(Domovská stránka projektu|Project home ?page)[:* ]*<(.*)>/) {
$url = $2;
}
}
+ if (!$project or !$name or !$url) {
+ print STDERR "Expected field missing in $file\n";
+ }
+
print STDERR "Working on student $name ($year)\n";
if (!$projects{$project}) {
$projects{$project} = {};
print '[[!meta title="Projekty"]]'."\n";
print '[[!meta stylesheet="/columns" rel="stylesheet"]]'."\n";
+print "\n";
+print 'This page lists the projects and which students worked on them in the'."\n";
+print 'past years.'."\n";
foreach (sort(keys(%projects))) {
print "\n* [$_](", $projects{$_}{'url'}, ")\n";