Dear Wiki user, You have subscribed to a wiki page or wiki category on "Freevo Wiki" for change notification.
The following page has been changed by 213.224.83.72: http://freevo.sourceforge.net/cgi-bin/moin.cgi/DocumentationPage_2fXmlTv The comment on the change is: Move TV_CHANNELS to a more logical section... ------------------------------------------------------------------------------ @@ -49,48 +49,6 @@ ln -s `date +'$HOME/freevo/xmltv/listings_%d%m%Y.xml'` /tmp/TV.xml }}} -If you're too lazy to edit local_conf.py manually, and you have a /tmp/TV.xml file downloaded, here's a small shell script which will generate the TV channels for you. You can then change the order or make corrections to the naming. - - {{{ -# cat /tmp/TV.xml | grep "id=" | awk '{FS="\""; a=a+1; print "(\x27" $2 "\x27, " \ -"\x27" $2 "\x27, \x27" a "\x27),"}' -}}} -or, alternatively, to create a sorted list: - {{{ -# grep "<channel id=" /tmp/TV.xml | sed -e 's#^.*<channel id="\([^"]\+\)">#\1#g' \ -| sort -n | awk '{a=a+1; printf("(\x27%s\x27, \x27%s\x27, \x27%s\x27),\n", $0, $0, a)}' -}}} - -If the above script is not parsing your TV listing properly, and you TV listing looks like: - {{{ - <channel id="C20tsn.zap2it.com"> - <display-name>20 TSN</display-name> - <display-name>20</display-name> - <icon src="http://tvlistings2.zap2it.com/tms_network_logos/tsn.jpg" /> - </channel> -}}} -Then try this script: - {{{ -#!/usr/bin/perl - -while (<STDIN>) { - chomp; - if (/^\s+<channel\sid=\"(.*)\">$/) { - $last_id = $1; - } elsif (/^\s+<display-name>(\d+)<\/display-name>$/) { - $last_chan = $1; - } elsif (/^\s+<display-name>\d+\s(.*)<\/display-name>$/) { - $last_name = $1; - } elsif (/^\s+<\/channel>$/) { - print "('$last_id', '$last_name', '$last_chan'),\n"; - } -} -}}} -Save it as 'xmltv2freevo.pl' or whatever, and execute it: - {{{ -./xmltv2freevo.pl </tmp/TV.xml -}}} - === Belgian listings === Use the program freevo/helpers/xml_tv_be.py which was contributed by Bart Heremans and den_RDC. Open helpers/xml_tv_be.config in your favorite text editor, and select wich channels you want the script to fetch, by setting a 0 after channels that shouldn't be fetched and a 1 for channels you want. You can also set the number of days to be fetched in the configuration file. @@ -175,6 +133,47 @@ Update the TV_CHANNELS variable in local_conf.py. [[BR]] Please see that file for more detailed instructions! +If you're too lazy to edit local_conf.py manually, and you have a /tmp/TV.xml file downloaded, here's a small shell script which will generate the TV channels for you. You can then change the order or make corrections to the naming. + + {{{ +# cat /tmp/TV.xml | grep "id=" | awk '{FS="\""; a=a+1; print "(\x27" $2 "\x27, " \ +"\x27" $2 "\x27, \x27" a "\x27),"}' +}}} +or, alternatively, to create a sorted list: + {{{ +# grep "<channel id=" /tmp/TV.xml | sed -e 's#^.*<channel id="\([^"]\+\)">#\1#g' \ +| sort -n | awk '{a=a+1; printf("(\x27%s\x27, \x27%s\x27, \x27%s\x27),\n", $0, $0, a)}' +}}} + +If the above script is not parsing your TV listing properly, and you TV listing looks like: + {{{ + <channel id="C20tsn.zap2it.com"> + <display-name>20 TSN</display-name> + <display-name>20</display-name> + <icon src="http://tvlistings2.zap2it.com/tms_network_logos/tsn.jpg" /> + </channel> +}}} +Then try this script: + {{{ +#!/usr/bin/perl + +while (<STDIN>) { + chomp; + if (/^\s+<channel\sid=\"(.*)\">$/) { + $last_id = $1; + } elsif (/^\s+<display-name>(\d+)<\/display-name>$/) { + $last_chan = $1; + } elsif (/^\s+<display-name>\d+\s(.*)<\/display-name>$/) { + $last_name = $1; + } elsif (/^\s+<\/channel>$/) { + print "('$last_id', '$last_name', '$last_chan'),\n"; + } +} +}}} +Save it as 'xmltv2freevo.pl' or whatever, and execute it: + {{{ +./xmltv2freevo.pl </tmp/TV.xml +}}} == Thanks == Much thanks to James Oakley of the openpvr project, who wrote the Python XMLTV parsing module which is used extensively for XMLTV support in Freevo. ------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ Freevo-wikilog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-wikilog