#!/usr/bin/perl
use Switch;
use XML::Simple;
use Text::Wrap;
use Encode;
$action = $ARGV[0];
$channel_index = $ARGV[1];
$file = "/tmp/tv.xml";
$Text::Wrap::columns = 49;
$indent = " ";
#====================================================================================
switch($action){
case "head" {
&load_data;
($channel_name, $time, $title) = split (/\s>\s|\n/, $tv->{channel}->{item}[$channel_index]->{title});
printf ("%-6s $time\n",encode_utf8($channel_name));
print encode_utf8(wrap $indent, $indent, $title);
}
case "description"{
&load_data;
print encode_utf8(wrap $indent, $indent, $tv->{channel}->{item}[$channel_index]->{description});
}
case "update"{
`wget -O - "http://www.tampiss.com/rss/tv_online.xml" > $file`;
}
}
#====================================================================================
sub load_data {
$xml = new XML::Simple(SuppressEmpty => 1);
$tv = $xml->XMLin($file);
}
to by mel byt ten program ( dej ho do .conky pod tv.pl ) a samozrejme spustitelny znak
${color #ffffff}TV${hr 1}
${color white}${execi 300 perl ~/.conky/tv.pl update}
${color #ffffff}${execi 300 perl ~/.conky/tv.pl head 0}
${color #ffffff}${execi 300 perl ~/.conky/tv.pl head 1}
${color #ffffff}${execi 300 perl ~/.conky/tv.pl head 2}
${color #ffffff}${execi 300 perl ~/.conky/tv.pl head 3}
a kousek .conkycr co se nam o to postara .
mozna to nepojede bo tam chybi nejaka knihovna s perl. ale z hlavy nwm ktera to je. budem doufat ze to pojede kdyby ne tak dej vedet a ja ji sezenu