KnoppMyth downloads | documentation | HowTo | reporting bugs | links | Recent Changes  
search for in the  

What is a Wiki?

See WikiWikiWeb

If you don't know how to use a wiki see the WikiHowto

ErfurtWiki is maintained by a loosely knit group of developers.

Quick Links

Related sites

Contact

Please submit website bugs in the BugReports

Contribute!

Please file any wishes on UserSuggestions.

Hosted By

#!/usr/bin/perl

my @channel_numbers;
my %num_name_id;

`wget http://www.digitalspy.co.uk/satellite/skyepg/`;
open (CFILE,'index.html');
foreach (<CFILE>)
{
        push(@channel_numbers,$_);
}

sub get_name_from_num
{
        my $num = shift;
        my $found_it = 0;
        foreach (@channel_numbers)
        {
                if ($found_it)
                {
                        if ($_ =~m/<b>(.*)<\/b>/)
                        {
                                return $1;
                        }
                }
                elsif ($_=~m/font-weight: 600;\">$num<\/td>/)
                {
                        $found_it = 1;
                }
        }
}

sub set_xmlid_with_name
{
        my $name = shift;
        my $id = shift;
        foreach (keys(%num_name_id))
        {
                if ($num_name_id{$_}{'name'}=~m/$name/i)
                {
                        #print("Matched $_ $name $id !\n");
                        $num_name_id{$_}{'id'} = $id;
                        return 1;
                }
        }
        #print("Could not match $name !\n");
        return 0;
}

foreach (@channel_numbers)
{
        if ($_=~m/font-weight: 600;\">(\d\d\d)<\/td>/)
        {
                my $name = get_name_from_num($1);
                $num_name_id{$1}{'name'}=$name;
                #print ("Channel number $1 name $name\n");
        }

}

my @raw_channel_list = `tv_grab_uk_rt --list-channels`;
my $look_for_name = 0;
my $look_for_id = 1;

`rm matched_channels`;
`rm matched_channels.xmltv`;
`rm unmatched_channels`;
`rm unmatched_channels.xmltv`;
open(MATCH,'>matched_channels');
open(MATCH2,'>matched_channels.xmltv');
open(UNMATCH,'>unmatched_channels');
open(UNMATCH2,'>unmatched_channels.xmltv');

sub get_name_from_id
{
        my $id = shift;
        my $found_it = 0;
        foreach (@raw_channel_list)
        {
                if ($found_it)
                {
                        $_ =~/<display-name>(.*)<\/display-name>/;
                        return $1;
                }
                if ($_ =~m/channel id=\"$id\"/)
                {
                        $found_it = 1;
                }
        }
}

foreach (@raw_channel_list)
{
        #print $_;
        if ($_ =~m/channel id=\"(.*)\"/)
        {
                my $name=get_name_from_id($1);
                set_xmlid_with_name($name,$1);
                #{
        #               print MATCH ("$name,$1\n");
#                       print MATCH2 ("channel $1\n");
#               }
                #$channels{$1}=0;
                #$look_for_name = 1;
        }

        #<channel id="west.bbc2.bbc.co.uk">
        #    <display-name>BBC2 West</display-name>


}

# Output the data
foreach (keys(%num_name_id))
{
        my $name = $num_name_id{$_}{'name'};
        my $id = $num_name_id{$_}{'id'};
        if ($name ne '' and $id ne '')
        {
                print("Matched $name\n");
                print MATCH ("$_,$name,$id\n");
                print MATCH2 ("channel $id\n");
        }
        else
        {
                print("Failed to match $name\n");
                print UNMATCH ("$_,$name,$id\n");
                print UNMATCH2 ("channel $id\n");
        }
}

close(MATCH,'>matched_channels');
close(MATCH2,'>matched_channels.xmltv');
close(UNMATCH,'>unmatched_channels');
close(UNMATCH2,'>unmatched_channels.xmltv');

print("Created the following files: \n\n");
print(" matched_channels         = input file for update_channels\n");
print(" matched_channels.xmltv   = corresponding .xmltv file to be copied into /home/mythtv/.mythtv/\n");
print(" unmatched_channels       = these are all the channel names I couldn't\n");
print("                            match from http://www.digitalspy.co.uk/satellite/skyepg/\n");
print(" unmatched_channels.xmltv = as above but .xmltv file\n");
print("\n\nNow you will have to manually add channels from unmatched_channels\n");
print("into matched channels (most notably BBC1, BBC2, ITV and 5 as these\n");
print("are specific to the region you live in\n\n");
print("You might also want to remove channels you don't subscribe to\n");
print("\nWhen you are finished, run update_channels matched_channels to update\n");
print("The sql database for Knoppmyth\n")


UpdatedPages

· MythwebFlash last changed on Tue Sep 7 08:01:14 2010
· HauppaugeThreeFiftyInstallation last changed on Tue Sep 7 07:59:50 2010
· MythStreamTV last changed on Tue Sep 7 07:58:13 2010
· UsingSambaHowto last changed on Tue Sep 7 07:57:01 2010
· TVOverScanHowto last changed on Tue Sep 7 07:53:19 2010
· TroubleShooting last changed on Mon Sep 6 15:33:02 2010
· Links last changed on Mon Sep 6 15:31:25 2010
· KnoppMythInstall last changed on Mon Sep 6 15:29:41 2010
· HowTo last changed on Mon Sep 6 15:26:44 2010
· TinnyAudioPVR150 last changed on Mon Sep 6 14:42:38 2010
· KnoppmythDownloads last changed on Sun Sep 5 22:27:51 2010
· LinuxTips last changed on Fri Sep 3 12:44:17 2010
· RepairingMythConvergDB last changed on Wed Sep 1 01:56:32 2010
· KnoppMythWiki last changed on Sun Aug 29 14:22:57 2010
· R5A12DvdRipping last changed on Fri Aug 27 22:24:09 2010
· HVR950HowTo last changed on Mon Aug 23 11:00:20 2010
· MythVodkaHowTo last changed on Mon Aug 23 00:48:53 2010
· x11vncHowTo last changed on Tue Aug 17 08:20:17 2010
· PickingComponents last changed on Tue Aug 17 08:19:41 2010
· MediaMVP_LinuxHOWTO last changed on Tue Aug 17 08:17:10 2010
· webminhowto last changed on Tue Aug 17 08:11:10 2010
· MythTVBurn_Scripts_HowTo last changed on Mon Aug 16 15:44:19 2010
· EditThisPage last changed on Wed Aug 4 04:10:39 2010
· R5.5/R6.x Differences Table and Equivalent Commands last changed on Wed Aug 4 00:27:20 2010
· Media_Center_Edition_Remote_Control last changed on Tue Aug 3 08:19:13 2010
· kworld115HowTo last changed on Tue Aug 3 08:12:26 2010
sitemap |