#!/usr/bin/perl system("rm -rf channels.dat*"); system("rm -rf 1-xmltv_radiotimes_com.xml*"); system("wget http://xmltv.radiotimes.com/xmltv/channels.dat"); my %hash = (); open(OUTPUT, '>', "1-xmltv_radiotimes_com.xml"); print OUTPUT "\n"; print OUTPUT "\n"; print OUTPUT " \n"; print OUTPUT " \n"; open(INPUT, "channels.dat") || die("Cannot open channels.dat configuration file"); my @lines = ; foreach my $line (@lines) { chomp($line); #print "line: $line\n"; if ($line =~ /.*\|.*/) { ($id, $channel) = split(/\|/, $line); #@arr = split(/|/, $line); #print "arr $arr[0]"; #print("id: $id\n"); #print("ch: $channel\n"); $channel =~ s/&/\+/; $hash{${channel}} = $id; } } foreach $key (sort keys %hash) { #print "$key: $hash{$key}\n"; print OUTPUT " \n"; } print OUTPUT " \n"; print OUTPUT " \n"; print OUTPUT " \n"; print OUTPUT " #TITLE~~#SUBTITLE~~~#ACTORS~~~#REPEAT~#SUBTITLES~~~~~~~#GENRE~#DESCRIPTION~~#DATE~#START~#END~\n\n"; print OUTPUT " \n"; print OUTPUT "\n"; close(OUTPUT); close(INPUT); #system("unix2dos 1-xmltv_radiotimes_com.xml"); system("cp 1-xmltv_radiotimes_com.xml /cygdrive/c/ProgramData/Team\\\ MediaPortal/MediaPortal\\\ TV\\\ Server/WebEPG/grabbers/GB/");