1# Generate tv_grab_se_swedb from tv_grab_se_swedb.in. This is done
2# to allow grabbers for other countries to use the same code.
3#
4
5use strict;
6
7use IO::File;
8my $out = shift @ARGV; die "no output file given" if not defined $out;
9my $in = 'grab/se_swedb/tv_grab_se_swedb.in';
10my $in_fh = new IO::File "< $in" or die "cannot read $in: $!";
11my $out_fh = new IO::File "> $out" or die "cannot write to $out: $!";
12my $seen = 0;
13while (<$in_fh>) {
14    s/\@\@name/tv_grab_se_swedb/;
15    s/\@\@nspc/                /;
16    s/\@\@country/Sweden/;
17    s/\@\@desc/Sweden (swedb\/tvsajten)/;
18    s%\@\@url%http://xmltv.tvsajten.com/channels.xml.gz%;
19    s%\@\@site%http://xmltv.tvsajten.com/%;
20    print $out_fh $_;
21}
22close $out_fh or die "cannot close $out: $!";
23close $in_fh or die "cannot close $in: $!";
24
25