]> bicyclesonthemoon.info Git - ott/bsta/blob - updlist.1.pl
8e8e6a2b0e6c7a98e6472e4262784d1a07b9009f
[ott/bsta] / updlist.1.pl
1 ###PERL;
2 #
3 # updlist.pl is generated from updlist.1.pl.
4 # 29.06.2017
5 #
6 # The framelist update bot
7 #
8 #    Copyright (C) 2016-2017  Balthasar SzczepaƄski
9 #
10 #    This program is free software: you can redistribute it and/or modify
11 #    it under the terms of the GNU Affero General Public License as
12 #    published by the Free Software Foundation, either version 3 of the
13 #    License, or (at your option) any later version.
14 #
15 #    This program is distributed in the hope that it will be useful,
16 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 #    GNU Affero General Public License for more details.
19 #
20 #    You should have received a copy of the GNU Affero General Public License
21 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 use strict;
24 #use warnings;
25 ###LIB;
26 use bsta_lib qw(readdatafile writedatafile);
27 use File::Copy;
28
29 ###DATA_PATH;
30 ###WWW_PATH;
31 ###SETTINGS_PATH;
32 ###STATE_PATH;
33 ###DEFAULT_PATH;
34 ###LIST_PATH;
35
36 my %framedata;
37 my %gotolist;
38
39 my $frame;
40
41 %gotolist=readdatafile(LIST_PATH);
42
43 for($frame=0; ; ++$frame) {
44         %framedata=readdatafile(DATA_PATH.$frame);
45         if($framedata{'ongtime'} eq '') {
46                 last;
47         }
48         
49         print $frame.' '.$framedata{'ongtime'}.' '.$framedata{'title'}."\n";
50         
51         $gotolist{'title-'.$frame}=$framedata{'title'};
52         $gotolist{'ongtime-'.$frame}=$framedata{'ongtime'};
53 }
54
55 writedatafile (LIST_PATH,%gotolist);