]> rtime.felk.cvut.cz Git - edu/osp-wiki.git/blob - student/projects.pl
Project final presentations date added.
[edu/osp-wiki.git] / student / projects.pl
1 #!/usr/bin/perl -w
2 use strict;
3 use Data::Dumper;
4
5 my %projects;
6
7
8 foreach my $year(qw/2010/) {
9     open LIST, "projects2010";
10     while (<LIST>) {
11         chomp;
12         my $file = $_;
13         my ($project, $url, $name);
14         open PAGE, $file;
15         while (<PAGE>) {
16             if (/(Název projektu|Project name)[:* ]*(.*)/) {
17                 $project = $2;
18             }
19             if (/(Domovská stránka projektu|Project home ?page)[:* ]*<(.*)>/) {
20                 $url = $2;
21             }
22             if (/\[\[!meta title="([^"]*)"\]\]/) {
23                 $name = $1;
24             }
25         }
26
27         if (!$projects{$project}) {
28             $projects{$project} = {};
29             $projects{$project}{'students'} = [];
30         }
31         my $p = $projects{$project};
32         $$p{'url'} = $url;
33         push @{$$p{'students'}}, { 'file' => $file, 'name' => $name, 'year' => $year };
34     }
35 }
36
37 print '[[!meta title="Projekty"]]'."\n";
38 print '[[!meta stylesheet="/columns" rel="stylesheet"]]'."\n";
39
40 foreach (sort(keys(%projects))) {
41     print "\n* [$_](", $projects{$_}{'url'}, ")\n";
42     #print Dumper($projects{$_}{'students'});
43     foreach (@{$projects{$_}{'students'}}) {
44         my $page = $_->{'file'};
45         $page =~ s|.mdwn$||;
46         $page =~ s|/index$||;
47         my $name = $_->{'name'} || "???";
48         my $year = $_->{'year'} || "20??";
49         
50         print "  * [[", $name || "", "|student/", $page, "]] ($year)\n";
51     }
52 }