Re: XMLTV and Israel? (fwd)

2007-02-05 Thread Alon Altman

Hi,
   I have a working xmltv setup here. It required some hacking into the
downloader code for Israel. First of all, you should use tvtime which has
xmltv support. Second, you need the tv_grab_il script attached. Third,
you'll need a cron job something like this (here I download twice per week):

20 6 * * 0,3 cp /home/alon/media/TV/listings.xml 
/home/alon/media/TV/listings.xml.old  /usr/local/bin/tv_grab_il | tv_sort  
/home/alon/media/TV/listings.xml

Fourth, you need to configure tvtime to use your XMLTV file and correctly
modify the ~/.tvtime/stationlist.xml file with XMLTV ids (I'm attaching my
file).

Good luck!

On Mon, 5 Feb 2007, Amichai Rotman wrote:

 Hi all,
 
 I would like to set up Freevo on my Ubuntu 6.10 box and make use of the TV
 guide feature. I understand it uses XMLTV to get the TV guide (like the EPG
 on digital broadcast) but I don't know how to set it up.
 
 I tried to follow the instructions but it is very unfriendly and confusing.
 
 Any of you know of an existing guide / HOWTO or did it him/her self?
 
 Thanks!
 


-- 
This message was sent by Alon Altman ([EMAIL PROTECTED]) ICQ:1366540
GPG public key at http://8ln.org/pubkey.txt
Key fingerprint = A670 6C81 19D3 3773 3627  DE14 B44A 50A3 FE06 7F24
--
  -=[ Random Fortune ]=-
Any philosophy that can be put in a nutshell belongs there.
-- Sydney J. Harris

-- Attached file included as plaintext by Listar --
-- File: tv_grab_il

#!/usr/bin/perl -w

=pod

=head1 NAME

tv_grab_il - Grab TV listings for Israel.

=head1 SYNOPSIS

tv_grab_il --help

tv_grab_il [--config-file FILE] --configure

tv_grab_il [--config-file FILE] [--output FILE] [--days N]
   [--offset N] [--quiet]

=head1 DESCRIPTION

Outputs TV listings for channels available in Israel (free to air, cable
and satellite). The data is obtained from parsing web pages from the Israeli
portal walla (from tv.walla.co.il).

First run Btv_grab_il --configure to decide which channels to download. There
is a long list. You may want to select none when it asks you for which
channels and manually edit the configuration file to uncomment the channels
you wish to tape. Then run Btv_grab_il with no arguments to output the
listing in XML format to the standard output.

To view the hebrew, you will need to set your terminal to have a unicode font
that supports hebrew.

B--configure Prompt for which channels, and write the configuration file.
B--config-file FILE Set the name of the configuration file, the
default is B~/.xmltv/tv_grab_il.conf.  This is the file written by
B--configure and read when grabbing.

B--output FILE write to FILE rather than standard output.

B--days N grab N days.  The default is 7 (there does not seem to be more
information than this anyway on the server in general).

B--offset N start N days in the future.  The default is to start
from today.

B--quiet suppress the progress messages normally written to standard
error.

=head1 SEE ALSO

Lxmltv(5).

=head1 AUTHOR

Written by Jason Friedman, [EMAIL PROTECTED] This program is
based on tv_grab_sn, written by Stefan G:orling, [EMAIL PROTECTED] and
maintained by Staffan Malmgren, [EMAIL PROTECTED]

Patched by Alon Altman.

Last updated: 5 February, 2007.

=head1 BUGS

The summer time routine uses the European summer time start and stop
dates which are different to those used in Israel. The correct times
can be found at
http://www.greenwichmeantime.com/local/asia/il.htm?israel+jerusalem+tel_aviv

=cut

use strict;
#binmode(STDOUT,:utf8);
#binmode(STDERR,:utf8);
use HTML::TreeBuilder;
use Date::Manip;
use Getopt::Long;
use Locale::Hebrew;
use Encode;
use XMLTV;
use XMLTV::Memoize;
use XMLTV::Ask;
use XMLTV::TZ qw(parse_local_date);
use XMLTV::DST qw(utc_offset);
use XMLTV::Config_file;
use XMLTV::Get_nice;
use XMLTV::Mode;
use XMLTV::Usage END
$0: get Israeli television listings in XMLTV format
To configure: $0 --configure [--config-file FILE]
To grab listings: $0 [--config-file FILE] [--output FILE] [--days N]
[--offset N] [--quiet]
END
  ;

# Use Term::ProgressBar if installed.
use constant Have_bar = eval { require Term::ProgressBar; 1 };

# Memoize some date parsing routines, if possible.  FIXME move to
# XMLTV::Memoize.
#
eval { require Memoize };
unless ($@) {
  foreach (qw(utc_offset ParseDate UnixDate dc fetch_data)) {
Memoize::memoize($_) or warn cannot memoize $_;
  }
}

sub xhead();
sub configure();
sub get_channels();
sub fetch_data ($$);
sub get_display_name ($);
sub process_file( $ );
sub read_config_file( $ );
sub dc ( $$ );
sub reencode ( $ );


# The base timezone (winter time) and summer time for Israel is 
# equivalent however the switchover dates are different (see BUGS)
my $BASE_TZ = EET;
my $PAGE_ENCODING = Windows-1255;
my $DOMAIN = 'tv.walla.co.il';

XMLTV::Memoize::check_argv('XMLTV::Get_nice::get_nice_aux');
my ($opt_days, $opt_help, $opt_output,
$opt_offset,$opt_configure, 

Re: XMLTV and Israel?

2007-02-05 Thread Alon Altman

Hi,
   I have a working xmltv setup here. It required some hacking into the
downloader code for Israel. First of all, you should use tvtime which has
xmltv support. Second, you need the tv_grab_il script attached. Third,
you'll need a cron job something like this (here I download twice per week):

20 6 * * 0,3 cp /home/alon/media/TV/listings.xml 
/home/alon/media/TV/listings.xml.old  /usr/local/bin/tv_grab_il | tv_sort  
/home/alon/media/TV/listings.xml

Fourth, you need to configure tvtime to use your XMLTV file and correctly
modify the ~/.tvtime/stationlist.xml file with XMLTV ids (I'm attaching my
file).

Good luck!

On Mon, 5 Feb 2007, Amichai Rotman wrote:

 Hi all,

 I would like to set up Freevo on my Ubuntu 6.10 box and make use of the TV
 guide feature. I understand it uses XMLTV to get the TV guide (like the EPG
 on digital broadcast) but I don't know how to set it up.

 I tried to follow the instructions but it is very unfriendly and confusing.

 Any of you know of an existing guide / HOWTO or did it him/her self?

 Thanks!



-- 
This message was sent by Alon Altman ([EMAIL PROTECTED]) ICQ:1366540
GPG public key at http://8ln.org/pubkey.txt
Key fingerprint = A670 6C81 19D3 3773 3627  DE14 B44A 50A3 FE06 7F24
--
  -=[ Random Fortune ]=-
Any philosophy that can be put in a nutshell belongs there.
-- Sydney J. Harris

-- Attached file included as plaintext by Listar --
-- File: tv_grab_il

#!/usr/bin/perl -w

=pod

=head1 NAME

tv_grab_il - Grab TV listings for Israel.

=head1 SYNOPSIS

tv_grab_il --help

tv_grab_il [--config-file FILE] --configure

tv_grab_il [--config-file FILE] [--output FILE] [--days N]
   [--offset N] [--quiet]

=head1 DESCRIPTION

Outputs TV listings for channels available in Israel (free to air, cable
and satellite). The data is obtained from parsing web pages from the Israeli
portal walla (from tv.walla.co.il).

First run Btv_grab_il --configure to decide which channels to download. There
is a long list. You may want to select none when it asks you for which
channels and manually edit the configuration file to uncomment the channels
you wish to tape. Then run Btv_grab_il with no arguments to output the
listing in XML format to the standard output.

To view the hebrew, you will need to set your terminal to have a unicode font
that supports hebrew.

B--configure Prompt for which channels, and write the configuration file.
B--config-file FILE Set the name of the configuration file, the
default is B~/.xmltv/tv_grab_il.conf.  This is the file written by
B--configure and read when grabbing.

B--output FILE write to FILE rather than standard output.

B--days N grab N days.  The default is 7 (there does not seem to be more
information than this anyway on the server in general).

B--offset N start N days in the future.  The default is to start
from today.

B--quiet suppress the progress messages normally written to standard
error.

=head1 SEE ALSO

Lxmltv(5).

=head1 AUTHOR

Written by Jason Friedman, [EMAIL PROTECTED] This program is
based on tv_grab_sn, written by Stefan G:orling, [EMAIL PROTECTED] and
maintained by Staffan Malmgren, [EMAIL PROTECTED]

Patched by Alon Altman.

Last updated: 5 February, 2007.

=head1 BUGS

The summer time routine uses the European summer time start and stop
dates which are different to those used in Israel. The correct times
can be found at
http://www.greenwichmeantime.com/local/asia/il.htm?israel+jerusalem+tel_aviv

=cut

use strict;
#binmode(STDOUT,:utf8);
#binmode(STDERR,:utf8);
use HTML::TreeBuilder;
use Date::Manip;
use Getopt::Long;
use Locale::Hebrew;
use Encode;
use XMLTV;
use XMLTV::Memoize;
use XMLTV::Ask;
use XMLTV::TZ qw(parse_local_date);
use XMLTV::DST qw(utc_offset);
use XMLTV::Config_file;
use XMLTV::Get_nice;
use XMLTV::Mode;
use XMLTV::Usage END
$0: get Israeli television listings in XMLTV format
To configure: $0 --configure [--config-file FILE]
To grab listings: $0 [--config-file FILE] [--output FILE] [--days N]
[--offset N] [--quiet]
END
  ;

# Use Term::ProgressBar if installed.
use constant Have_bar = eval { require Term::ProgressBar; 1 };

# Memoize some date parsing routines, if possible.  FIXME move to
# XMLTV::Memoize.
#
eval { require Memoize };
unless ($@) {
  foreach (qw(utc_offset ParseDate UnixDate dc fetch_data)) {
Memoize::memoize($_) or warn cannot memoize $_;
  }
}

sub xhead();
sub configure();
sub get_channels();
sub fetch_data ($$);
sub get_display_name ($);
sub process_file( $ );
sub read_config_file( $ );
sub dc ( $$ );
sub reencode ( $ );


# The base timezone (winter time) and summer time for Israel is 
# equivalent however the switchover dates are different (see BUGS)
my $BASE_TZ = EET;
my $PAGE_ENCODING = Windows-1255;
my $DOMAIN = 'tv.walla.co.il';

XMLTV::Memoize::check_argv('XMLTV::Get_nice::get_nice_aux');
my ($opt_days, $opt_help, $opt_output,
$opt_offset,$opt_configure,