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