How to config for ScheduleDirect XMLTV Listings...

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
I've got a ScheduleDirect account and I've config'd my channel list up at their website, but I can't seem to find any info on ehat I'm supposed to do to config this in MH. there's a tv_xml parm in the ini that's supposed to point to some file, but I don't know where to get that file.
 
Also, what about the logon credentials and stuff for accessing ScheduleDirect?
 
Rick

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Jim Duda
Administrator
Rick,

I use XMLTV for schedules direct.  On linux, I have XMLTV installed.
To configure my login information, etc, I use tv_grab_na_dd -configure

I use cron to download the XMLTV listings each night:
0 2 * * * /usr/bin/tv_grab_na_dd --output /media/xmltv/TV.xml

To process the XMLTV grid, I have this in one of my code files:

run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5
-outdir /home/misterhouse/data/web/tv";

Hope this helps.

Jim


Rick Bolen wrote:

> I've got a ScheduleDirect account and I've config'd my channel list up
> at their website, but I can't seem to find any info on ehat I'm supposed
> to do to config this in MH. there's a tv_xml parm in the ini that's
> supposed to point to some file, but I don't know where to get that file.
>  
> Also, what about the logon credentials and stuff for accessing
> ScheduleDirect?
>  
> Rick
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
> ________________________________________________________
> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03

And if you need info on windows I'm the other side of that :-)

You don't need the login information directly in MH, because the
script you run to gather the xml file does that work for you and
provides the XML.

I just run:
run_voice_cmd 'Get all TV XML data' as an alarm event for time_cron
'0 2 * * 3,6'

Rick S.

At 10:30 PM 11/6/2008, Jim Duda wrote:

>Rick,
>
>I use XMLTV for schedules direct.  On linux, I have XMLTV installed.
>To configure my login information, etc, I use tv_grab_na_dd -configure
>
>I use cron to download the XMLTV listings each night:
>0 2 * * * /usr/bin/tv_grab_na_dd --output /media/xmltv/TV.xml
>
>To process the XMLTV grid, I have this in one of my code files:
>
>run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5
>-outdir /home/misterhouse/data/web/tv";
>
>Hope this helps.
>
>Jim
>
>
>Rick Bolen wrote:
> > I've got a ScheduleDirect account and I've config'd my channel list up
> > at their website, but I can't seem to find any info on ehat I'm supposed
> > to do to config this in MH. there's a tv_xml parm in the ini that's
> > supposed to point to some file, but I don't know where to get that file.
> >
> > Also, what about the logon credentials and stuff for accessing
> > ScheduleDirect?
> >
> > Rick
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >
> >
> > ------------------------------------------------------------------------
> >
> > ________________________________________________________
> > To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=1365
> >
>
>
>-------------------------------------------------------------------------
>This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>Build the coolest Linux based applications with Moblin SDK & win great prizes
>Grand prize is a trip for two to an Open Source event anywhere in the world
>http://moblin-contest.org/redirect.php?banner_id=100&url=/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
In reply to this post by Jim Duda
Back to this again... grrrrr.

I'm stuck on an old Debian Sarge box for now, and the apt repository has [an
old?] XMLTV package, which I have installed. However, when I run
"tv_grab_na_dd --configure" it bombs with:

Fetching from DataDirect
Service description
'http://docs.tms.tribune.com/tech/tmsdatadirect/zap2it/xtvd.wsdl' can't be
loaded: 403 Forbidden

I've entered a valid timezone, username and password for my Schedules Direct
account. I've defined a "lineup" up at schedulesdirect.com within my
account, but I have no idea how to retrieve the xml data, or where I would
generate\find the xtvd.wsdl file (which is hardcoded in tv_grab_na_dd... and
may be an old data format\filename?).

Is the "'http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?

Is there anyway to download the xml file from schedules direct using their
web interface?

Anyone have any idea what I'm doing wrong?

Thanks,

Rick



----- Original Message -----
From: "Jim Duda" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, November 06, 2008 10:30 PM
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...


> Rick,
>
> I use XMLTV for schedules direct.  On linux, I have XMLTV installed.
> To configure my login information, etc, I use tv_grab_na_dd -configure
>
> I use cron to download the XMLTV listings each night:
> 0 2 * * * /usr/bin/tv_grab_na_dd --output /media/xmltv/TV.xml
>
> To process the XMLTV grid, I have this in one of my code files:
>
> run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5
> -outdir /home/misterhouse/data/web/tv";
>
> Hope this helps.
>
> Jim
>
>
> Rick Bolen wrote:
> > I've got a ScheduleDirect account and I've config'd my channel list up
> > at their website, but I can't seem to find any info on ehat I'm supposed
> > to do to config this in MH. there's a tv_xml parm in the ini that's
> > supposed to point to some file, but I don't know where to get that file.
> >
> > Also, what about the logon credentials and stuff for accessing
> > ScheduleDirect?
> >
> > Rick
> >
> >
> > ------------------------------------------------------------------------
> >
>
> -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >
> >
> > ------------------------------------------------------------------------
> >
> > ________________________________________________________
> > To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365
> >
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> Build the coolest Linux based applications with Moblin SDK & win great
prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ________________________________________________________
> To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365
>
>


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
In reply to this post by Jim Duda
Back to this again... grrrrr.

I'm stuck on an old Debian Sarge box for now, and the apt repository has [an
old?] XMLTV package, which I have installed. However, when I run
"tv_grab_na_dd --configure" it bombs with:

Fetching from DataDirect
Service description
'http://docs.tms.tribune.com/tech/tmsdatadirect/zap2it/xtvd.wsdl' can't be
loaded: 403 Forbidden

I've entered a valid timezone, username and password for my Schedules Direct
account. I've defined a "lineup" up at schedulesdirect.com within my
account, but I have no idea how to retrieve the xml data, or where I would
generate\find the xtvd.wsdl file (which is hardcoded in tv_grab_na_dd... and
may be an old data format\filename?).

Is the "'http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?

Is there anyway to download the xml file from schedules direct using their
web interface?

Anyone have any idea what I'm doing wrong?

Thanks,

Rick



----- Original Message -----
From: "Jim Duda" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, November 06, 2008 10:30 PM
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...


> Rick,
>
> I use XMLTV for schedules direct.  On linux, I have XMLTV installed.
> To configure my login information, etc, I use tv_grab_na_dd -configure
>
> I use cron to download the XMLTV listings each night:
> 0 2 * * * /usr/bin/tv_grab_na_dd --output /media/xmltv/TV.xml
>
> To process the XMLTV grid, I have this in one of my code files:
>
> run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5
> -outdir /home/misterhouse/data/web/tv";
>
> Hope this helps.
>
> Jim
>
>
> Rick Bolen wrote:
> > I've got a ScheduleDirect account and I've config'd my channel list up
> > at their website, but I can't seem to find any info on ehat I'm supposed
> > to do to config this in MH. there's a tv_xml parm in the ini that's
> > supposed to point to some file, but I don't know where to get that file.
> >
> > Also, what about the logon credentials and stuff for accessing
> > ScheduleDirect?
> >
> > Rick
> >
> >
> > ------------------------------------------------------------------------
> >
>
> -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >
> >
> > ------------------------------------------------------------------------
> >
> > ________________________________________________________
> > To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365
> >
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> Build the coolest Linux based applications with Moblin SDK & win great
prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ________________________________________________________
> To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365
>
>


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
In reply to this post by Rick Bolen(gm)
New issue and resolution to original...

*** Issue ***

I now have a TV.xml with valid data, but when I...

run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5..."

I get html files with only the stations listed and no program data.

Has anything changed in get_tv_grid_xmltv recently?


*** Resolution ***

'http://docs.tms.tribune.com/tech...xtvd.wsdl'
was not a valid url anymore.

'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelive
ry.wsdl'

is the valid url for $dd_service in tv_grab_na_dd.

----- Original Message -----
From: "Rick Bolen (GM)" <[hidden email]>
>
> Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?
>


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03
Jim and I were I think the last people to make major mods to that code.

I run (as an Alarm in MH):
run_voice_cmd 'Get all TV XML data'

with (in mh.private.ini)
tv_provider_name=Time Warner Cable - Durham
tv_name=TV
tv_xml = d:/temp/tv.xml

I update the XML file as a scheduled task inside of windows.

That tv code code changed a LOT to get things to work with schedules
direct. I made changes to simpler ways sometimes because I couldn't
grok the way it was done prior. There's also a lot of code in there
that I just left to be sure I didn't break something I didn't
understand but doesn't really do anything anymore. But a lot of those
command extensions aren't relevant any more.

The version I've got on my local machine of get_tv_grid_xmltv is
dated 6/1/08, with the last update line being:
#   05/--/08 Some general updates to fix requiring an .ini entry

Mines working great, so we can probably figure out what we need to
change between the two of us.

Rick S


At 03:24 PM 12/6/2008, Rick Bolen \(GM\) wrote:

>New issue and resolution to original...
>
>*** Issue ***
>
>I now have a TV.xml with valid data, but when I...
>
>run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5..."
>
>I get html files with only the stations listed and no program data.
>
>Has anything changed in get_tv_grid_xmltv recently?
>
>
>*** Resolution ***
>
>'http://docs.tms.tribune.com/tech...xtvd.wsdl'
>was not a valid url anymore.
>
>'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelive
>ry.wsdl'
>
>is the valid url for $dd_service in tv_grab_na_dd.
>
>----- Original Message -----
>From: "Rick Bolen (GM)" <[hidden email]>
> >
> > Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?
> >
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
Thanks Rick. I'm using over-the-air broadcast listings, so format may differ
there.

In looking at the raw xml there appear to be 2 main data chunks, <channel>
and <programme>, as follows:

  <channel id="I19603.labs.zap2it.com">
    <display-name>3 WBTVDT</display-name>
    <display-name>3 WBTVDT PC:28210</display-name>
    <display-name>3</display-name>
    <display-name>23 WBTVDT fcc</display-name>
    <display-name>WBTVDT</display-name>
    <display-name>WBTVDT (WBTV-DT)</display-name>
    <display-name>CBS Affiliate</display-name>
  </channel>

  <programme start="20081205233500 -0500" stop="20081206003500 -0500"
channel="I19603.labs.zap2it.com">
    <title lang="en">Football Friday Night</title>
    <category lang="en">Sports non-event</category>
    <category lang="en">Football</category>
    <category lang="en">Limited Series</category>
    <episode-num system="dd_progid">SH006827.1100</episode-num>
  </programme>

My guess is that there's an issue with mapping the programme's "channel=..."
into channel's "id=..." with a correct time grid. Can you cut\paste
representative sections of your TV.xml into a test file for me (or just send
the whole xml file if small enough - but I'm guessing it's rather large).

Rick


----- Original Message -----
From: "Rick Steeves" <[hidden email]>
To: "The main list for the MisterHouse home automation program"
<[hidden email]>; "The main list for the
MisterHouse home automation program"
<[hidden email]>
Sent: Saturday, December 06, 2008 5:26 PM
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...


> Jim and I were I think the last people to make major mods to that code.
>
> I run (as an Alarm in MH):
> run_voice_cmd 'Get all TV XML data'
>
> with (in mh.private.ini)
> tv_provider_name=Time Warner Cable - Durham
> tv_name=TV
> tv_xml = d:/temp/tv.xml
>
> I update the XML file as a scheduled task inside of windows.
>
> That tv code code changed a LOT to get things to work with schedules
> direct. I made changes to simpler ways sometimes because I couldn't
> grok the way it was done prior. There's also a lot of code in there
> that I just left to be sure I didn't break something I didn't
> understand but doesn't really do anything anymore. But a lot of those
> command extensions aren't relevant any more.
>
> The version I've got on my local machine of get_tv_grid_xmltv is
> dated 6/1/08, with the last update line being:
> #   05/--/08 Some general updates to fix requiring an .ini entry
>
> Mines working great, so we can probably figure out what we need to
> change between the two of us.
>
> Rick S
>
>
> At 03:24 PM 12/6/2008, Rick Bolen \(GM\) wrote:
> >New issue and resolution to original...
> >
> >*** Issue ***
> >
> >I now have a TV.xml with valid data, but when I...
> >
> >run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days
5..."

> >
> >I get html files with only the stations listed and no program data.
> >
> >Has anything changed in get_tv_grid_xmltv recently?
> >
> >
> >*** Resolution ***
> >
> >'http://docs.tms.tribune.com/tech...xtvd.wsdl'
> >was not a valid url anymore.
> >
>
>'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDeliv
e
> >ry.wsdl'
> >
> >is the valid url for $dd_service in tv_grab_na_dd.
> >
> >----- Original Message -----
> >From: "Rick Bolen (GM)" <[hidden email]>
> > >
> > > Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently
valid?
> > >
> >
> >
>
>---------------------------------------------------------------------------
---
> >SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
> >The future of the web can't happen without you.  Join us at MIX09 to help
> >pave the way to the Next Web now. Learn more and register at
>
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com
/
> >________________________________________________________
> >To unsubscribe from this list, go to:
> >http://sourceforge.net/mail/?group_id=1365
>
>
>
>
> --------------------------------------------------------------------------
----
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ________________________________________________________
> To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365
>
>


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03
Replied with attachment off list.


At 06:30 PM 12/6/2008, Rick Bolen \(GM\) wrote:

>Thanks Rick. I'm using over-the-air broadcast listings, so format may differ
>there.
>
>In looking at the raw xml there appear to be 2 main data chunks, <channel>
>and <programme>, as follows:
>
>   <channel id="I19603.labs.zap2it.com">
>     <display-name>3 WBTVDT</display-name>
>     <display-name>3 WBTVDT PC:28210</display-name>
>     <display-name>3</display-name>
>     <display-name>23 WBTVDT fcc</display-name>
>     <display-name>WBTVDT</display-name>
>     <display-name>WBTVDT (WBTV-DT)</display-name>
>     <display-name>CBS Affiliate</display-name>
>   </channel>
>
>   <programme start="20081205233500 -0500" stop="20081206003500 -0500"
>channel="I19603.labs.zap2it.com">
>     <title lang="en">Football Friday Night</title>
>     <category lang="en">Sports non-event</category>
>     <category lang="en">Football</category>
>     <category lang="en">Limited Series</category>
>     <episode-num system="dd_progid">SH006827.1100</episode-num>
>   </programme>
>
>My guess is that there's an issue with mapping the programme's "channel=..."
>into channel's "id=..." with a correct time grid. Can you cut\paste
>representative sections of your TV.xml into a test file for me (or just send
>the whole xml file if small enough - but I'm guessing it's rather large).
>
>Rick
>
>
>----- Original Message -----
>From: "Rick Steeves" <[hidden email]>
>To: "The main list for the MisterHouse home automation program"
><[hidden email]>; "The main list for the
>MisterHouse home automation program"
><[hidden email]>
>Sent: Saturday, December 06, 2008 5:26 PM
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>
> > Jim and I were I think the last people to make major mods to that code.
> >
> > I run (as an Alarm in MH):
> > run_voice_cmd 'Get all TV XML data'
> >
> > with (in mh.private.ini)
> > tv_provider_name=Time Warner Cable - Durham
> > tv_name=TV
> > tv_xml = d:/temp/tv.xml
> >
> > I update the XML file as a scheduled task inside of windows.
> >
> > That tv code code changed a LOT to get things to work with schedules
> > direct. I made changes to simpler ways sometimes because I couldn't
> > grok the way it was done prior. There's also a lot of code in there
> > that I just left to be sure I didn't break something I didn't
> > understand but doesn't really do anything anymore. But a lot of those
> > command extensions aren't relevant any more.
> >
> > The version I've got on my local machine of get_tv_grid_xmltv is
> > dated 6/1/08, with the last update line being:
> > #   05/--/08 Some general updates to fix requiring an .ini entry
> >
> > Mines working great, so we can probably figure out what we need to
> > change between the two of us.
> >
> > Rick S
> >
> >
> > At 03:24 PM 12/6/2008, Rick Bolen \(GM\) wrote:
> > >New issue and resolution to original...
> > >
> > >*** Issue ***
> > >
> > >I now have a TV.xml with valid data, but when I...
> > >
> > >run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days
>5..."
> > >
> > >I get html files with only the stations listed and no program data.
> > >
> > >Has anything changed in get_tv_grid_xmltv recently?
> > >
> > >
> > >*** Resolution ***
> > >
> > >'http://docs.tms.tribune.com/tech...xtvd.wsdl'
> > >was not a valid url anymore.
> > >
> >
> >'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDeliv
>e
> > >ry.wsdl'
> > >
> > >is the valid url for $dd_service in tv_grab_na_dd.
> > >
> > >----- Original Message -----
> > >From: "Rick Bolen (GM)" <[hidden email]>
> > > >
> > > > Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently
>valid?
> > > >
> > >
> > >
> >
> >---------------------------------------------------------------------------
>---
> > >SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
>Nevada.
> > >The future of the web can't happen without you.  Join us at MIX09 to help
> > >pave the way to the Next Web now. Learn more and register at
> >
> >http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com
>/
> > >________________________________________________________
> > >To unsubscribe from this list, go to:
> > >http://sourceforge.net/mail/?group_id=1365
> >
> >
> >
> >
> > --------------------------------------------------------------------------
>----
> > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
>Nevada.
> > The future of the web can't happen without you.  Join us at MIX09 to help
> > pave the way to the Next Web now. Learn more and register at
> >
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> > ________________________________________________________
> > To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
> >
> >
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Mickey Argo-2
In reply to this post by Rick Bolen(gm)
I had the same problem...all the stations but no show data on the tv grid.
If I made changes to the lineup on SchedulesDirect, I would see the changes
in the web page but still no data.

I then made a one line change to get_tv_grid_xmltv and now everything seems
to work just fine.

I changed line 185 from
$parms{hour} = '6pm' unless $parms{hour};

To
$parms{hour} = 'all' unless $parms{hour};

I believe I had set $parms{hour} in my int file before making this change
but that did not help.

Make the change, re-run the get tv grid, and see if that helps

Mickey Argo

 

-----Original Message-----
From: Rick Bolen (GM) [mailto:[hidden email]]
Sent: Saturday, December 06, 2008 2:25 PM
To: The main list for the MisterHouse home automation program
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...

New issue and resolution to original...

*** Issue ***

I now have a TV.xml with valid data, but when I...

run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5..."

I get html files with only the stations listed and no program data.

Has anything changed in get_tv_grid_xmltv recently?


*** Resolution ***

'http://docs.tms.tribune.com/tech...xtvd.wsdl'
was not a valid url anymore.

'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelive
ry.wsdl'

is the valid url for $dd_service in tv_grab_na_dd.

----- Original Message -----
From: "Rick Bolen (GM)" <[hidden email]>
>
> Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?
>


----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
Thanks Mickey. I tried your suggestion, but no change. I've also updated to
the latest svn (1577).

There's other factors at work here. My SD data is for over-the-air digital
broadcasters. Standard tv channels are now further divided into sub-channels
(up to 5 for a single channel). At the moment, get_tv_grid_xmltv is not
discerning this, and only recognizes\lists one (sub)channel... and I haven't
figured out how it matches programme info to a specific channel yet, but it
won't likely match pgm info to subchannels before it discerns subchannels.

So, as always, suggestions are welcome and appreciated,

Rick

----- Original Message -----
From: "Mickey Argo" <[hidden email]>

> I had the same problem...all the stations but no show data on the tv grid.
> If I made changes to the lineup on SchedulesDirect, I would see the
changes
> in the web page but still no data.
>
> I then made a one line change to get_tv_grid_xmltv and now everything
seems

> to work just fine.
>
> I changed line 185 from
> $parms{hour} = '6pm' unless $parms{hour};
>
> To
> $parms{hour} = 'all' unless $parms{hour};
>
> I believe I had set $parms{hour} in my int file before making this change
> but that did not help.
>
> Make the change, re-run the get tv grid, and see if that helps
>
> Mickey Argo


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03
In reply to this post by Mickey Argo-2

Interesting, because that likely means that my code doesn't match
source (I don't have that change, yet mine works).

Since in theory it was my code uploaded to fix xmltv to work with
schedules direct, then either I missed providing something that I
changed  (likely) or something else odd.

I'll try pulling the code from the MH source, diff it, and get back
to you. I'll bet the issue is in get_tv_grid ...

Rick

At 08:17 PM 12/6/2008, Mickey Argo wrote:

>I had the same problem...all the stations but no show data on the tv grid.
>If I made changes to the lineup on SchedulesDirect, I would see the changes
>in the web page but still no data.
>
>I then made a one line change to get_tv_grid_xmltv and now everything seems
>to work just fine.
>
>I changed line 185 from
>$parms{hour} = '6pm' unless $parms{hour};
>
>To
>$parms{hour} = 'all' unless $parms{hour};
>
>I believe I had set $parms{hour} in my int file before making this change
>but that did not help.
>
>Make the change, re-run the get tv grid, and see if that helps
>
>Mickey Argo
>
>
>
>-----Original Message-----
>From: Rick Bolen (GM) [mailto:[hidden email]]
>Sent: Saturday, December 06, 2008 2:25 PM
>To: The main list for the MisterHouse home automation program
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>New issue and resolution to original...
>
>*** Issue ***
>
>I now have a TV.xml with valid data, but when I...
>
>run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5..."
>
>I get html files with only the stations listed and no program data.
>
>Has anything changed in get_tv_grid_xmltv recently?
>
>
>*** Resolution ***
>
>'http://docs.tms.tribune.com/tech...xtvd.wsdl'
>was not a valid url anymore.
>
>'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelive
>ry.wsdl'
>
>is the valid url for $dd_service in tv_grab_na_dd.
>
>----- Original Message -----
>From: "Rick Bolen (GM)" <[hidden email]>
> >
> > Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?
> >
>
>
>----------------------------------------------------------------------------
>--
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
>
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03

Well, it looks like I never uploaded my last set of updates/changes
as they're not in the 2.105 code, and they look like the changes are
in that section you reference.

My get_tv_grid also looks different, but it will take me longer to
figure out why.

I don't think the list accepts attachments, here's the code for
get_tv_grid_xmltv:

#!/usr/bin/perl

# $Date$
# $Revision$
#
#---------------------------------------------------------------------------
#  File:
#      get_tv_grid_xmltv
#  Description:
#      See help text below
#  Author:
#      Bruce Winter    [hidden email]   http://misterhouse.net
#  Latest version:
#      http://misterhouse.net/mh/bin
#  Change log:
#    04/25/98  Created.
#    02/--/02  Tom Witmer ([hidden email]) adds mods
#       11/--/07  Jim Duda changed to work with XMLTV and schedulesdirect.org
#       11/--/07  Rick Steeves ([hidden email]) updated to build
#                          ia5 web pages from the XMLTV data
#   05/--/08 Some general updates to fix requiring an .ini entry
#---------------------------------------------------------------------------

#---------------------------------------------------------------------------
#  Purpose:
#      For the days/times/channels listed, retrieve the listing data
#          from an external XML file generated by xmltv from
schedulesdirect.org and
#      store it in the listings DB.
#
#  Notes for the future:
#    - ASSUMPTION: Shows in grid do not indicate their true start or end
#      times, if they cross grid boundaries. This is somewhat avoidable
#      by choosing long durations (6 hours max), and might be partially
#      fixable by adjusting shows that seem to "repeat". (This won't work
#      for shows that are listed twice in a row, however!)
#    - Would be nice to get only primetime data for weekdays, and all
#      data for weekends. This is not yet incorporated.
#
#       Requires that a current XML files exists pulled from
schedulesdirect.org
#       using XMLTV. This file needs to be updated by running xmltv on a daily
#       basis for updates.
#       The file location should be defined in mh.private.ini as tv_xml.
#       Example:
#               tv_xml= f:/temp/tv.xml
#
#---------------------------------------------------------------------------

use strict;

#======================================================================
# Version info
#======================================================================
my($Pgm_Path, $Pgm_Name, $Version);
BEGIN {
    ($Version) = q$Revision: 1084 $ =~ /: (\S+)/; # Note: revision
number is auto-updated by cvs
    ($Pgm_Path, $Pgm_Name) = $0 =~ /(.*)[\\\/](.*)\.?/;
    ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
    eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So
perl2exe works
}

use XMLTV::Version '$Id: tv_to_text,v 1.4 2003/06/29 15:53:51 epaepa Exp $ ';
use IO::File;
use Date::Manip; Date_Init('TZ=UTC');
use POSIX 'tmpnam';
use Getopt::Long;
use XMLTV qw(best_name);
use vars '%config_parms';  # Not a my, as called from handy_net_utils
use Time::Local;

#======================================================================
# Variable declarations and other init
#======================================================================
# Globals
#
my ( %parms, $infile, $channel_data );
my (@hours, @uas);
my ($dbm_file, $dbm_file2);
my (%DBM, %DBM2, %DBM_channel, %DBM_html, %DBM_index);  # DBM_html is
extended data for HTML
my (%showtimes);
my @weekday  = qw (Sun Mon Tue Wed Thu Fri Sat);

#======================================================================
# Check invocation options, and print usage message if necessary
#======================================================================
if (!&GetOptions(\%parms, "h", "help", "infile=s", "outfile=s", "outdir=s",
    "db=s", "keep=s", "skip=s", "channel_max=s", "channel_min=s",
    "debug", "label=s", "keep_old","purge=s",
    "days=s", "day=s", "hour=s") or @ARGV or
    ($parms{h} or $parms{help}))
{
    print<<eof;
$Pgm_Name reads a TV grid/schedule from an XML file generated from
(schedulesdirect.org) for it to be used by the MisterHouse program
to create VCR and TV event reminders.

Creates a DBM for use by get_tv_info.
   Version: $Version
   Usage:
    $Pgm_Name [options]
    -h        => This help text
    -help     => This help text
    -db   xyz      => xyz is the database (tv, sat, cable, default tv)
    -name xyz      => xyz is the name of the service (TV, Dish Network,
                      Cable, etc) default is TV
    -day xyz      => xyz is the day  to get/filter.  Default is today.
    -hour xyz     => xyz is the hour to get/filter.  Default is 6pm.  Can also
                     be 'all' to get all hours.
    -days xyz     => xyz is the number of days to get/filter, starting
                     with -day.
    -channel_max xyz  => Channels above xyz will be dropped.  Default is 9999.
    -channel_min xyz  => Channels below xyz will be dropped.  Default is 1.
    -infile  xyz  => xyz is  input file, and XML file from XMLTV.
    -outfile xyz  => xyz the filtered output file.
                     Default is -outdir/day_hour.html
    -outdir  xyz  => xyz the directory the outfiles will be put in.
                     Default is mh.ini parm html_dir/{db}
    -purge  xyz  => Purge entries older than xyz days old.
    -label xyz    => Use xyz as the link lable.  Default is "VCR".
                     To disable, set to none (-label none).
    -redo         => Rebuilds the web page, even if a recent file it exits
    -timebars xyz   => Number of channels between timebars in output table.
                     Default is 5.
    -keep_old     => Do NOT delete data from the DBM that is one month older
                     than todays date
    -debug        => turn on debug info

   Example:
    $Pgm_Name -infile /media/xmtv/TV.xml

eof
   exit;
}

sub days_from_now
{
    my ($day_time, $days) = @_;
    my $day_time2 = $day_time + $days * 60 * 60 * 24;
    my ($day, $month, $year, $down) = (localtime($day_time2))[3,4,5,6];
    my $dow = (qw(Sunday Monday Tuesday Wednesday Thursday Friday
Saturday))[$down];

    $month++;
    $year += 1900;
    $day = sprintf("%02d", $day);
    return ($dow, $down, $day, $month, $year);
}


#======================================================================
# SUB: hour_to_min
# required to figure out the column width
# the old way you knew the column witdh from parsing the HTML
#======================================================================
sub hour_to_min
{
    my ($time) = @_;
    my ($hour, $minute) = $time =~ /(\d+):(\d+)/;
    my $minutes = $minute + $hour * 60;
    return $minutes;
}

#======================================================================
# SUB: setup
# Process invocation parameters prior to doing any real work
#======================================================================
sub setup
{
    &main::read_mh_opts(\%config_parms, $Pgm_Path);

    #------------------------------------------------------------
    # Process Incoming Parameters, defaulting as necessary
    #------------------------------------------------------------
    $parms{purge}   = 2 unless $parms{purge};
    $parms{timebars} = 5 unless $parms{timebars};
    $parms{days}    = 1 unless $parms{days};
    $parms{db}      = 'tv'  unless $parms{db};
    $parms{outdir}  ="$config_parms{html_dir}/$parms{db}"
       unless $parms{outdir};
    $parms{name}    = 'TV' unless  $parms{name} ;
    $parms{hour}    = $config_parms{$parms{db}.'_hours'} unless $parms{hour};

     $parms{hour} = '6pm' unless $parms{hour};
     @hours = qw(02 06 10 14 18 22);
         %showtimes = (
                         $hours[0] => ['02:00 AM', '02:30 AM', '03:00
AM', '03:30 AM', '04:00 AM', '04:30 AM', '05:00 AM', '05:30 AM'],
                         $hours[1] => ['06:00 AM', '06:30 AM', '07:00
AM', '07:30 AM', '08:00 AM', '08:30 AM', '09:00 AM', '09:30 AM'],
                         $hours[2] => ['10:00 AM', '10:30 AM', '11:00
AM', '11:30 AM', '12:00 PM', '12:30 PM', '1:00 PM', '1:30 PM'],
                         $hours[3] => ['2:00 PM', '2:30 PM', '3:00
PM', '3:30 PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM'],
                         $hours[4] => ['6:00 PM', '6:30 PM', '7:00
PM', '7:30 PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM'],
                         $hours[5] => ['10:00 PM', '10:30 PM', '11:00
PM', '11:30 PM', '00:00 AM', '00:30 AM', '01:00 AM', '01:30 AM'],
                 );

    $parms{duration}= 4 unless ( $parms{duration} );

    $parms{label} = "VCR" unless $parms{label};  # This can also be
an image link
    $parms{days}  = 1 unless $parms{days};
    $parms{redo}  = 1;
    $parms{duration}  = 6 unless $parms{duration};

    # Set up DBM files
    $dbm_file  = "$config_parms{data_dir}/$parms{db}_programs.dbm";
    $dbm_file2 = "$config_parms{data_dir}/$parms{db}_channels.dbm";
    # Setting up for HTML output
    print "Tieing to $dbm_file\n";
    use Fcntl;
    use DB_File;
    tie (%DBM,  'DB_File',  $dbm_file,  O_RDWR|O_CREAT, 0666) or
print "\nError, can not open dbm file $dbm_file: $!";
    tie (%DBM2, 'DB_File',  $dbm_file2, O_RDWR|O_CREAT, 0666) or
print "\nError, can not open dbm file $dbm_file2: $!";

}

#======================================================================
# SUB: createOutputDirs
# Create any directories/files that need creating prior to downloads
#======================================================================
sub createOutputDirs
{
    mkdir $parms{outdir}, 0777 unless -d $parms{outdir};

    if ( ! -d $parms{outdir} )
    {
       print "FAILED TO MAKE DIR: $parms{outdir} \n";
    }
    if ( ! -d $parms{outdir}."/logos" )
    {
       print "XMLTV Logos missing: $parms{outdir}/logos \n";
    }
}


#======================================================================
# SUB: processRawFile
# Takes the DBM_html array and builds the HTML pages
#======================================================================
sub processRawFile
{
         createOutputDirs();
         my $day_time = time;
         #------------------------------------------------------------
         # For each number of days we're asked to retrieve...
         #------------------------------------------------------------
         for my $count ( 0 .. $parms{days} )
         {
                 #------------------------------------------------------------
                 # Calculate the date/time of this day
                 #------------------------------------------------------------
                 my @day_data = days_from_now( time, $count );
                 my ($dow, $down, $day, $month, $year) = split(' ',
"@day_data");
                 my $startDay = ${month}."/".${day}."/".${year};

                 # Calculate the epoch time for the beginning of this day.
                 # Lets us do date/time math while not having to worry so much
                 # about end of day/month/year crossovers
                 my $month_epoch = $month -1;
                 my $day_epoch = timelocal(0,0,0,$day,$month_epoch,$year);

                 #------------------------------------------------------------
                 # For each hour we're supposed to retrieve...
                 #------------------------------------------------------------
                 for my $startHour( @hours )
                 {
                 my $hour = $startHour;
                                 my $channel_number = '';
                                 my $channel_name = '';
                                 my $current_time_bar = '';
                                 my $rowOfLastTimeBar = 0;
                                 my $rowsInCurrentOutTable  = 0;

                                 # Convert the starting grid hour to
epoch seconds
                                 #    from AM/PM to 24
                                 my $grid_start_epoch = ampm_to_hour24($hour);
                                 #    to seconds of the particular day
                                 $grid_start_epoch =
&hour_to_min($grid_start_epoch) * 60;
                                 #    and add from midnight
                                 $grid_start_epoch =
$grid_start_epoch + $day_epoch;

                                 # And calculate the end of the end
of the grid in epoch seconds
                                 # A hack for now. Needs to caculate
based of the actual end
                                 my $grid_end_epoch =
$grid_start_epoch + 14400;

                 #------------------------------------------------------------
                 # Calculate the name of the output file
                 #------------------------------------------------------------
                 my $outfile = "$parms{outdir}/${day}_${startHour}.html";

                 #------------------------------------------------------------
                 # If output file already exists, and is recent enough, use
                 # keep it instead of rebuilding it.
                 #------------------------------------------------------------
                 if ( (-e $outfile) and (8 > -M $outfile) and
                         (4000 < -s $outfile) and !$parms{redo} and
!$parms{debug} )
                 {
                         print "Reusing: $outfile\n";
                 } else {

                                 print "Processing array to
$parms{outdir} $outfile\n" if ($parms{debug});

                                 #------------------------------------------------------------
                                 # Open files and start the output HTML
                                 #------------------------------------------------------------
                                 open (OUT, ">$outfile") || die
"Error, could not open file $outfile: $!\n";
                                 print OUT<<eof;
<HTML>
<HEAD>
<TITLE>$parms{name} Schedule for $dow, $month/$day/$year</TITLE>
<meta http-equiv="Expires" content="Fri, Jun 12 1981 08:20:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
</HEAD>
<body bgcolor=gray>
eof

                                 #------------------------------------------------------------
                                 # Create date/time menu selection
javascript header to page.
                                 # (Lets user jump to a different date/time)
                                 #------------------------------------------------------------
                                 &make_index($hour, $down, $day, $day_time);

                                 # This should also really go into make_index
                                 ##############################################
                                 print OUT qq|<table border="1"
BGCOLOR="#FFFFFF" CELLPADDING="2" CELLSPACING="1" WIDTH="">\n|;
                                 $current_time_bar = qq|<tr><td
colspan=2 align="center" bgcolor="#663366" width="60"><a
href="/tv/$day\_$hour.html"><input border="0" width=60 height=30
type="image" name="earlier" src="/tv/logos/leftArrow.gif"
value="earlier"></a></td>\n|;
                                 foreach my $showtime (@{ $showtimes{$hour}}) {
                                 $current_time_bar .= qq|<td
bgcolor="#ffffff"><center><font face="arial, helvetica" size="2"
color=""><b><nobr>$showtime</nobr></b></center></font></td>\n|;
                                 }

                                 $current_time_bar .= qq|<td
colspan=2 align="center" bgcolor="#663366" width="60"><a
href="/tv/$day\_$hour.html"><input border="0" width=60 height=30
type="image" name="later" src="/tv/logos/rightArrow.gif"
value="later"></a></td>\n|;
                                 $current_time_bar .= "</tr>\n";
                                 print OUT $current_time_bar;

                                 # end of what should go into make_index
                                 ########################################

                                 # Generate the listing of show times.
                                 # Loop through for each channel in
sorted order
                                 foreach my $key (sort { $a <=> $b }
(keys(%DBM_channel))) {
                                         # Check for every channel
                                         # if past midnight adjust
the date to "tomorrow"
                                         my ($channel_number,
$channel_name, $channel_affiliate, $channel_image, $channel_ID) =
split($;, $DBM_channel{$key});
                                         my $channel_number_display =
$channel_number;
                                         my $show_found = 0;  # when
the beginning of the channel
                                                                                         #
has nothing in it, to fill in the blanks
                                         my $colspan = 0;  # keep
track of how wide a show is
                                         my $colspancount = 0;  #
track width of ttl grid
                                         my $show_found = 0;  # has a
show been found yet
                                         my $max_col_span = 8;  #
Maximum # of columns in table
                                         # so we can figure out when
the day flips
                                         my $its_late = 0;

                                         my $row_started = 0;

                                         $rowsInCurrentOutTable++;
                                         # Print the channel
information on the left
                                         print OUT qq|<tr
width="100%"><td bgcolor="#ffffff" align="center"
colspan="2">$channel_image$channel_number_display<br>$channel_name</td>\n|;

                                         # Check each defined
interval to see if a show is starting
                                         foreach my $showtime (@{
$showtimes{$hour}}) {
                                                 #
                                                 # Calculate the
starting hour in epoch time
                                                 # Convert the
showtime start to epoch seconds
                                                 #    from AM/PM to 24
                                                 my $showtime_epoch =
ampm_to_hour24($showtime);
                                                 #    to seconds of
the particular day
                                                 $showtime_epoch =
&hour_to_min($showtime_epoch) * 60;
                                                 # if we're at the
beginning of a day, add a day of time, because it's now tomorrow
                                                 if (($showtime eq
'00:00 AM') || ($its_late)) {
                                                         $showtime_epoch
= $showtime_epoch + 86400;
                                                         $its_late = 1;
                                                 }
                                                 $showtime_epoch =
$showtime_epoch + $day_epoch;

                                                 my
($pgm_date,$pgm_time) =  &convert_epoch_to_time($showtime_epoch);
                                                 my $db_key =
join($;, $channel_number, $pgm_date, $pgm_time);

                                                 # If there is a
value for the half hour interval
                                                 # figure out how
long the show is and print the HTML
                                                 if ($DBM_html{$db_key}) {
                                                         $show_found = 1;
                                                         my
($time_end, $pgm_name, $pgm_title, $pgm_air, $time_start,
$time_start_adj, $time_end_adj, $pgm_rating, $pgm_desc,
$pgm_date_end, $epoch_start, $epoch_end, @pgm_category) = split($;,
$DBM_html{$db_key});

                                                         # calculate
how many columns the show will take up.
                                                         # using the
difference in two times for determining grid width.
                                                         $colspan =
int(($epoch_end/60 - $epoch_start/60)/30);
                                                         # If the
show is longer than is left on the table,
                                                         #
decrease width to available space
                                                         if
(($colspancount + $colspan) > $max_col_span) {
                                                                 do {
$colspan = $colspan -1; } until (( ($colspancount + $colspan) <=
$max_col_span) | $colspan < 2 );
                                                         }
                                                         $colspancount
= $colspancount + $colspan;

                                                         # Define the
program listing for display to the grid
                                                         print OUT
&display_program($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channel_number,$time_start,$time_start_adj,$time_end,$pgm_date,
$colspan,@pgm_category);

                                                 } elsif
((!($show_found)) & (!($row_started))) {
                                                         # If we
didn't find a show go look in the last grid
                                                         # see if
it's in the array searching backward for a few hours
                                                         my
$grid_time_search = $grid_start_epoch;
                                                         for (my
$i=1; $i <= 8; $i++) {
                                                                 #
Figure out when the last time was
                                                                 #
back up time 30 minutes
                                                                 $grid_time_search
= $grid_time_search - (30 * 60); # Backup 30 minutes
                                                                 my
($pgm_date_loop, $pgm_time_loop) = &convert_epoch_to_time($grid_time_search);
                                                                 #Build a key
                                                                 my
$search_key = join($;, $channel_number, $pgm_date_loop, $pgm_time_loop);
                                                                 if
($DBM_html{$search_key}) {
                                                                         #
then hey we found it
                                                                         my
($time_end, $pgm_name, $pgm_title, $pgm_air, $time_start,
$time_start_adj, $time_end_adj, $pgm_rating, $pgm_desc,
$pgm_date_end, $epoch_start, $epoch_end, @pgm_category) = split($;,
$DBM_html{$search_key});
                                                                         #
Show has to end before the beginning of grid or we don't really care
and it's a lost cause
                                                                         if
($epoch_end > $grid_start_epoch) {
                                                                                 #
Figure out the column width
                                                                                 $colspan
= int(($epoch_end/60 - $grid_start_epoch/60)/30);
                                                                                 #
and of course display the info
                                                                                 print
OUT
&display_program($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channel_number,$time_start,$time_start_adj,$time_end,$pgm_date,$colspan,@pgm_category);
                                                                                 $show_found
= 1;
                                                                                 $row_started
= 1;
                                                                                 $i
= 10; # Kick ourselves out of the loop because we found it
                                                                                 $colspancount
= $colspan;
                                                                         }
                                                                 }
                                                                 #
and if not back up another 30 minutes
                                                         }
                                                         # Otherwise
just leave it blank and do the best you can
                                                         if
(!($show_found))     {

                                                                 print
OUT qq|<td bgcolor="#ffffff" colspan="1" width="10%" valign="top"></td>\n|;
                                                                 $colspancount++;
                                                                 $row_started
= 1;
                                                         }
                                 }       elsif
(!($show_found))  {

                                                         print OUT
qq|<td bgcolor="#ffffff" colspan="1" width="10%" valign="top"></td>\n|;
                                                         $colspancount++;
                                                         $row_started = 1;
                                                 }

                                 $row_started = 0;
                         }
                                         if ($colspancount <
$max_col_span ) {  # fix for blanks at the end of the channel
                                                 my $colspan =
$max_col_span - $colspancount;
                                 print OUT qq|<td bgcolor="#ffffff"
colspan="$colspan" width="$colspan| . qq|0%" valign="top"></td>\n|;
                         }
                                         # print the channel
information on the right
                                         print OUT qq|<td
bgcolor="#ffffff" align="center"
colspan="2">$channel_image$channel_number_display<br>$channel_name</td>\n</tr>\n|;
                                         #------------------------------------------------------------
                                         # Do we need to generate a
new timebar?
                                         #------------------------------------------------------------
                                         if ( $rowsInCurrentOutTable
% $parms{timebars} == 0 ) {
                                                 print OUT $current_time_bar;
                                         }
                                 }
                                 print OUT "</table></body></html>\n";

                                 close OUT;

                                 #------------------------------------------------------------
                                 # Find listing for "prime time" and
make it the default index file.
                                 # Also, email it to someone if we
have the means of doing so.
                                 #------------------------------------------------------------
                                 if ( $day == (localtime(time))[3]
and $startHour >  17 and $startHour <= 20) {
                                         use File::Copy;
                                         copy($outfile,
"$parms{outdir}/index.html");
                                         print "Copied $outfile  to
$parms{outdir}/index.html\n" if $parms{debug};
                                         if ($parms{mail_to} ) {
                                                 &mail_file($parms{mail_to},
$parms{mail_server}, $outfile, "$parms{name} Schedule for $dow,
$month/$day/$year");
                                         }
                                 }
                         }
                 }
         }
}

#======================================================================
# SUB: make_index
# Create the index table, for the next 2 weeks, and for other hours in
# this day
#======================================================================
sub make_index {
    my ($hour, $down, $day, $day_time) = @_;
    print OUT "<center>\n<table border=1 width=100%>\n<tr>\n<td
align=left>\n";      ### DW: remove bgcolors

    print OUT "<font face=arial size=+1 color=white> Listings for
$parms{name} </td><td align=right>";
    print OUT "<FORM>";

    #----------------------------------------------------------------------
    # Notes to any who care: Use different window targets for different
    # results:
    #  _blank= new browser window
    #  _self = current browser window
    #  _parent = window superior to the frame
    #  _top = cancels all frames, loads in full browser window
    #  In this case, I'm using the named "output" frame, which seems to
    #  be the friendliest way to do this (in my own humble opinion.)
    #  Feel free to change this if you like.
    #----------------------------------------------------------------------
    #print OUT "<SELECT NAME=url
onchange=window.open(this.options[this.selectedIndex].value,'output')>\n";
    print OUT "<SELECT NAME=url
onchange=window.open(this.options[this.selectedIndex].value,'menu')>\n";
    #my $dow_start = -$down - 7;
    my $dow_start =  -$parms{purge};
    my $dow_stop  = 7;
#  my $dow_stop  = $parms{days} -1;
    for my $count ($dow_start .. $dow_stop) {
        my ($dow2, $dow2n, $day2, $month2, $year2) =
&days_from_now($day_time, $count);
        print OUT "<option value='/" . $parms{db} . "/${day2}_$hour.html'";

        if ($day2 == $day)  {
          print OUT " Selected ";
        }
        print OUT ">$dow2, $month2/$day2\n";
    }
    print OUT "</select>\n";
    print OUT "<SELECT NAME=tvtime
onchange=window.open(this.options[this.selectedIndex].value,'output')>\n";

    for my $hour2 (@hours) {
        my $hour2_ampm;

        if ($hour2 == 12) {
            $hour2_ampm = "12 pm";
        }
        elsif ($hour2 > 12) {
            $hour2_ampm = $hour2 - 12 . " pm";
        }
        elsif ($hour2 == 0) {
            $hour2_ampm = "12 am";
        }
        else {
            $hour2_ampm = $hour2 + 0 . " am";
        }
         print OUT "<option value='/" . $parms{db} . "/${day}_${hour2}.html'";
         if ($hour2 == $hour)  {
           print OUT " Selected ";
         }

         print OUT ">$hour2_ampm\n";
    }
    print OUT "</select>\n</td>\n";
    print OUT "</tr>\n</form></table></center>\n";
}


#======================================================================
# SUB: delete_old_data
# Delete data that doesn't fall into the following range:
#   $parms{purge} days ago through 7 days from now
#======================================================================
sub delete_old_data {
    my @dates;
    for (-14..$parms{purge}) {
       my ($dow, $down, $day, $month) = &days_from_now(time, -$_ );
       push @dates,"$month/$day";
    }
    print "Deleting old data more than $parms{purge} days ago ...\n";
    print "Keeping these dates ONLY: @dates\n";

    my ($key,$value);
    while (($key,$value) = each %DBM) {
       my ($channel, $date, $time)=split($;, $key);
       # don't delete it if the date matches
       next if (grep (/^$date$/, @dates) > 0);
       delete $DBM{$key};
    }

    print "Compressing non-purged data\n";

    my $dbm_file_temp=$dbm_file.'.temp';

    unlink $dbm_file_temp if -e $dbm_file_temp;

    my %DBM_TEMP;
    tie (%DBM_TEMP,  'DB_File',  $dbm_file_temp,  O_RDWR|O_CREAT,
0666) or die "Error, can not open dbm file $dbm_file_temp: $!";

    # copy hash info over to new DBM file
    %DBM_TEMP=%DBM;

    # untie these two hashes
    untie %DBM;
    untie %DBM_TEMP;

    # delete old DBM file
    rename ($dbm_file, $dbm_file.'.to.be.deleted') or die "can't
rename to .to.be.deleted: $!" ;
    rename $dbm_file_temp, $dbm_file or die "can't rename from temp
to real: $!";
    unlink $dbm_file.'.to.be.deleted';

    # clear hash
    undef %DBM;

    # retie hash
    tie (%DBM,  'DB_File',  $dbm_file,  O_RDWR|O_CREAT, 0666) or die
"Error, can not open dbm file $dbm_file the second time: $!";
    print "Finished deleting old data\n";
}

sub delete_old_data_html {
    #my ($down, $down, $day, $month) = &days_from_now(time, -28);
    my ($dow, $down, $day, $month) = &days_from_now(time, $parms{purge} * -1 );
    my $pgm_date = "$month/$day";
    print "Deleting old data from $parms{purge} days ago: $pgm_date ...\n";

    for my $hour (00 .. 27) {
        $hour = '0' . $hour if $hour < 10;
        my $outfile = "$parms{outdir}/${day}_${hour}.html";
        unlink $outfile if -f $outfile;
         }
}


#======================================================================
# fetchLoop
#======================================================================
sub fetchLoop
{
         #-------------------------------------------------------
         # Blow away the old data
         #-------------------------------------------------------
         &delete_old_data unless $parms{keep_old};
         &delete_old_data_html unless $parms{keep_old};
         my ($pgm_date);
         print "Reading in XMLTV file (takes a bit)...\n" if $parms{debug};
         my ($encoding, $credits, $ch, $progs) =
@{XMLTV::parsefiles($parms{infile})};

         #
         # Read all the channel-associated information into hash %DBM2.
         #
         my $langs = [ 'en' ];
         foreach (values %$ch) {
                 my $channel_affiliate = ''; # assume it's not an
affiliate station
                 my $channel_image = '';         # assume there's no
image for the channel
                 my $channel_image_path;
                 my $channel_ID = $_->{id};  # XMLTV Channel ID
                 # Pick the best name for the channel
                 my ($channel, $lang) = @{XMLTV::best_name($langs,
$_->{'display-name'})};
                 my ($channel_number, $channel_name) = $channel =~
/^(.*) (.*)/;
                 # Check to see if the station is a network affiliate.
                 foreach my $key (@{$_->{'display-name'}}) {
                         my $key2 = "@$key";
                         if ($key2 =~ /Affiliate/) {
                                 ( $channel_affiliate ) = $key2 =~
/(^.*) Affiliate/;
                         }
                         else { $channel_affiliate = ''; }
                 }
                 # Check to see if there's an associated image for the channel
                 if ($channel_affiliate) {
                         # for some reason some of the channel icons
are gifs, others jpgs.
                         # Check for both
                         $channel_image_path = $parms{outdir} .
'/logos/' . lc($channel_affiliate) . '.gif';
                         if ( (-e $channel_image_path) ) {
                                 $channel_image = qq|<img
src="/tv/logos/$channel_affiliate.gif"><br>|;
                         } else {
                                 $channel_image_path = $parms{outdir}
. '/logos/' . lc($channel_affiliate) . '.jpg';
                                 if ( (-e $channel_image_path) ) {
                                         $channel_image = qq|<img
src="/tv/logos/$channel_affiliate.jpg"><br>|;
                                 }
                                 if (!($channel_image)) {
$channel_image = "$channel_affiliate<br>"; }
                         }
                 }
                 # and if it's not an affiliate it could still have
an icon.
                 else {
                         $channel_image_path = $parms{outdir} .
'/logos/'. lc($channel_name) . '.jpg';
                         if ( (-e $channel_image_path) ) {
                                 $channel_image = qq|<img
src="/tv/logos/$channel_name.jpg"><br>|;
                         }
                 }

                 $DBM2{$channel_number} = $channel_name;

                 my $db_data = join($;, $channel_number,
$channel_name, $channel_affiliate, $channel_image, $channel_ID);
                 $DBM_channel{$channel_number} = $db_data;
                 # DBM_index cross references between channels and programs
                 $DBM_index{$channel_ID} = join($;, $channel_number,
$channel_ID);
         }

         #
         # Read all the program-associated information into hash %DBM.
         # and %DBM_html.
         #
         foreach (@$progs) {
                 my $lang = '';
                 my $channel_ID = $_->{channel};
                 my ($channel_number, $channel_ID) = split($;,
$DBM_index{$channel_ID});

                 my ($time_end_XML) = $_->{stop};
                 my ($pgm_date_end, $time_end ) = &time_from_XML($_->{stop});
                 my $epoch_end = &convert_XML_to_epoch($time_end_XML);

                 my ($time_start_XML) = $_->{start};
                 my ($pgm_date, $time_start ) = &time_from_XML($_->{start});
                 my $epoch_start = &convert_XML_to_epoch($time_start_XML);

                 my $time_start_adj = &time_adj($time_start);
                 my $time_end_adj = &time_adj($time_end);

                 my $pgm_air = substr $_->{date},0,4;

                 my $pgm_name = '';
                 if (defined $_->{title}) {
                         foreach (@{$_->{title}}) { ($pgm_name, $lang) = @$_; }
                 }
                 my $pgm_title = '';
                 if (defined $_->{'sub-title'}) {
                         foreach (@{$_->{'sub-title'}}) {
($pgm_title, $lang) = @$_; }
                         $pgm_title = $pgm_title;
                 }
                 $pgm_name =~ s/  / /g;     # Drop extra spaces
                 $pgm_name =~ s/\s+$//;     # remove trailing spaces

                 my $pgm_desc = '';
                 if (defined $_->{desc}) {
                         foreach (@{$_->{desc}}) { ($pgm_desc, $lang) = @$_; }
                 }
                 my $pgm_rating = '';
                 my $pgm_chip = '';
                 my $pgm_other = '';
                 if (defined $_->{rating}) {
                         foreach (@{$_->{rating}}) { ($pgm_rating,
$pgm_chip, $pgm_other) = @$_; }
                 }

                 my @pgm_category = ();
                 my $lang = '';
                 if (defined $_->{'category'}) {
                         foreach (@{$_->{'category'}} ) {
                                 my ($category, $lang) = @$_;
                                 push (@pgm_category, $category);
                         }
                 }

                 my $pgm_name_full = "$pgm_name: $pgm_title" if
defined $pgm_title;
                 $pgm_name_full =~ s/  / /g;     # Drop extra spaces
                 $pgm_name_full =~ s/\s+$//;     # remove trailing spaces

                 # %DBM_html is an extended data set from %DBM, so we
can muck with it and
                 # not screw with the actual database. Also would be
much bigger.
                 my $html_key = join($;, $channel_number, $pgm_date,
$time_start_adj);
                 my $html_data = join($;, $time_end, $pgm_name,
$pgm_title, $pgm_air, $time_start, $time_start_adj, $time_end_adj,
$pgm_rating, $pgm_desc, $pgm_date_end, $epoch_start, $epoch_end,
@pgm_category);
                 $DBM_html{$html_key} = $html_data;
                 my $db_key = join($;, $channel_number, $pgm_date,
$time_start);
                 my $db_data= join($;, $time_end, $pgm_name_full, 0);
                 $DBM{$db_key} = $db_data;
                 #print "DBM: db key=$db_key\ndata=$db_data.\n" if
$parms{debug};
         }
}

# ========================================================
# sub ampm_to_hour24
# Converts time from clock time to 24 hour time
# ========================================================
sub ampm_to_hour24 {
     my ($hour, $min, $ampm) = @_[0] =~ /(\d+):?(\d*) *(\S*)/;
     $hour += 12 if uc($ampm) eq 'PM' and $hour  < 12;
     $hour -= 12 if uc($ampm) eq 'AM' and $hour == 12;
     $hour = sprintf("%02d", $hour);
         $min = "00" unless $min;
     $hour .= ":$min";
     return $hour;
}

# ========================================================
# sub time_from_XML
# Convert the XML time to clock time/date
# ========================================================
sub time_from_XML {
         my ($time) = @_;
         $time =~ /(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)\d\d -.*/;
         my @time_strip = ($1 , $2 , $3 , $4 , $5);
         my @time_split = ();
         foreach (@time_strip) {
                 push (@time_split, sprintf("%02d", $_));
         }
         my ($yy,$mm,$dd,$hr,$mn) = @time_split;
         return ("$mm/$dd"),("$hr:$mn");
}

# ========================================================
# sub convert_XML_to_epoch
# Convert the XML time to epoch time
#     Note: "norms" the time
# ========================================================
sub convert_XML_to_epoch {
         my ($time_xml, $time) = @_;
         $time_xml =~ /(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d) -.*/;
         my ($year, $month, $mday, $hour, $min, $sec) = ($1 , $2 , $3
, $4 , $5, $6);
         $month = $month -1;  # to fix for XML vs timelocal

         # Norm the time
         if ($min >= 0 & $min <= 15) { $min=0; }
         elsif ($min > 15 & $min <= 45) { $min=30; }
         elsif ($min > 45 & $min <= 59) { $min=0; }

         $time = timelocal($sec,$min,$hour,$mday,$month,$year);
         return $time;
}

# ========================================================
# sub convert_epoch_to_time
# Switches epoch time to  date, 24 hour time
# ========================================================
sub convert_epoch_to_time {
         my ($epoch) = @_;
         my ($Second, $Minute, $Hour, $DayofMonth, $WrongMonth,
$WrongYear, $WeekDay, $DayofYear, $IsDST) = localtime($epoch);
         my $Month = $WrongMonth+1;
         my $Year = $WrongYear + 1900;
         return (sprintf('%02d/%02d', $Month,
$DayofMonth),sprintf('%02d:%02d', $Hour, $Minute));
}

# ========================================================
# sub convert_time_to_epoch
# Switches normal time to epoch time
# ========================================================
sub convert_time_to_epoch {
         my ($sec,$min,$hour,$mday,$month,$year) = @_;
         $month = $month -1;
         my $time = timelocal($sec,$min,$hour,$mday,$month,$year);
         return $time;
}

#======================================================================
# sub time_adj
# Fix the time so that shows have a consistent beginning or end
# ending exactly on the hour or half hour
#
# Dumb stations that decided to have shows start at, say, 11:35
# makes finding them in the index hard
#
# could have also solved this by reading through the index one minute
# at a time and in hindsight that might have been easier
#======================================================================
sub time_adj {
         my ($time) = @_;
         my ($hour, $min) = $time =~ /(.*):(.*)/;
         my $time_adj = '';
         if ( !( $min eq '30' | $min eq '00')) {
                 if ($min >= 0 & $min <= 15) { $time_adj = $hour . ':00'; }
                 elsif ($min > 15 & $min <= 45) { $time_adj = $hour . ':30'; }
                 elsif ($min > 45 & $min <= 59) { $time_adj = $hour . ':00'; }
         } else {$time_adj = "$hour:$min";}
         return $time_adj;
}

#======================================================================
# sub pgm_color
# Selects the display color for programs based on their Category
# Picks the first category for the show
# Defaults to grey
#=====================================================================
sub pgm_color {
         # Determine the background color for the TV shows in the grid.
         my ($pgm_category) = @_;
         my $pgm_color = '#cccccc';  # Default color
         if ($pgm_category =~ /Action/) { $pgm_color = '#99ccff'; }
         elsif ($pgm_category =~ /Adventure/) { $pgm_color = '#99ccff'; }
         elsif ($pgm_category =~ /Bus/) { $pgm_color = '#9999cc'; }
         elsif ($pgm_category =~ /Children/) { $pgm_color = '#ccffcc'; }
         elsif ($pgm_category =~ /Comedy/) { $pgm_color = '#99ccff'; }
         elsif ($pgm_category =~ /Crime/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Drama/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Fantasy/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Game show/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Horror/) { $pgm_color = '#ff0000'; }
         elsif ($pgm_category =~ /Music/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Mystery/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /News/) { $pgm_color = '#9999cc'; }
         elsif ($pgm_category =~ /Paid/) { $pgm_color = '#ffffcc'; }
         elsif ($pgm_category =~ /Paranormal/) { $pgm_color = '#ffffcc'; }
         elsif ($pgm_category =~ /Reality/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Science/) { $pgm_color = '#0033ff'; }
         elsif ($pgm_category =~ /Shopping/) { $pgm_color = '#ffffcc'; }
         elsif ($pgm_category =~ /Sitcom/) { $pgm_color = '#ffff66'; }
         elsif ($pgm_category =~ /Special/) { $pgm_color = '#ccff33'; }
         elsif ($pgm_category =~ /Sports/) { $pgm_color = '#ffcc00'; }
         elsif ($pgm_category =~ /Suspense/) { $pgm_color = '#cccccc'; }
         elsif ($pgm_category =~ /Travel/) { $pgm_color = '#9999cc'; }
         elsif ($pgm_category =~ /Weather/) { $pgm_color = '#9999cc'; }
         else { $pgm_color = '#cccccc'; }
         return $pgm_color;
}

#======================================================================
# sub display_program
# Builds the HTML for an individual program display
#======================================================================
sub display_program {
         # Make the Display output for the tv_grid html page
         my
($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channel_number,$time_start,$time_start_adj,$time_end,$pgm_date,$colspan,@pgm_category)
= @_;
         my ($program, $pgm_category, $pgm_color,$time_wrong);

         # Format the program category, color-code as appropriate
         # Pick the color from the first listed category
         foreach my $key (@pgm_category) {
                 # Filter out "series" - who really cares
                 if (!($key =~ /Series/)) {
                         if ($pgm_category) { $pgm_category .= "/" . $key; }
                         else {
                                 $pgm_category = $key;
                                 $pgm_color = &pgm_color($pgm_category);
                         }
                 }
         }

         $program = "<B>$pgm_name</B>";
         $program .= ": <i>$pgm_title</i>" if ($pgm_title);
         $program .= ".";
         $program .= " (" if (defined $pgm_category || defined $pgm_air);
         $program .= "$pgm_air, " if ($pgm_air);
         $program .= "$pgm_category" if defined $pgm_category;
         $program .= "). " if (defined $pgm_category || defined $pgm_air);

         $program .= " $pgm_desc" if defined $pgm_desc;
         $program .= " $pgm_rating" if defined $pgm_rating;

         if ($parms{label} eq "VCR") {
                 $program = q|<a
href='/SET:last_spoken?$tv_grid?channel_| . $channel_number .
'_from_' . $time_start . '_to_' . $time_end . '_on_' . $pgm_date .
'_for_' . $pgm_name . q|'>VCR</a> for | . $program;
         }
         # When the start time isn't exactly right, display it
         if ($time_start ne $time_start_adj) {
                 $time_wrong = qq|(<i>$time_start</i>) |;
         }
         $program = qq|<td bgcolor="$pgm_color" colspan="$colspan"
width="$colspan| . qq|0%" valign="top">$time_wrong$program</td>|;

         return $program;
}


#======================================================================
# M A I N
#======================================================================
setup();
if ( -1 == fetchLoop() )
{
    print "Grid Update failed\n";
    exit -1;
}

# If a HTML directory has been defined, parse through the $DBM arrays and
# generate the ia5 web pages
if ($parms{outdir}) { processRawFile(); }

print "Grid Update for $parms{db} complete\n";

untie %DBM;
untie %DBM2;




At 10:23 PM 12/6/2008, Rick Steeves wrote:

>Interesting, because that likely means that my code doesn't match
>source (I don't have that change, yet mine works).
>
>Since in theory it was my code uploaded to fix xmltv to work with
>schedules direct, then either I missed providing something that I
>changed  (likely) or something else odd.
>
>I'll try pulling the code from the MH source, diff it, and get back
>to you. I'll bet the issue is in get_tv_grid ...
>
>Rick
>
>At 08:17 PM 12/6/2008, Mickey Argo wrote:
>>I had the same problem...all the stations but no show data on the tv grid.
>>If I made changes to the lineup on SchedulesDirect, I would see the changes
>>in the web page but still no data.
>>
>>I then made a one line change to get_tv_grid_xmltv and now everything seems
>>to work just fine.
>>
>>I changed line 185 from
>>$parms{hour} = '6pm' unless $parms{hour};
>>
>>To
>>$parms{hour} = 'all' unless $parms{hour};
>>
>>I believe I had set $parms{hour} in my int file before making this change
>>but that did not help.
>>
>>Make the change, re-run the get tv grid, and see if that helps
>>
>>Mickey Argo
>>
>>
>>
>>-----Original Message-----
>>From: Rick Bolen (GM) [mailto:[hidden email]]
>>Sent: Saturday, December 06, 2008 2:25 PM
>>To: The main list for the MisterHouse home automation program
>>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>>
>>New issue and resolution to original...
>>
>>*** Issue ***
>>
>>I now have a TV.xml with valid data, but when I...
>>
>>run "mh_run get_tv_grid_xmltv -infile /media/xmltv/TV.xml -db tv -days 5..."
>>
>>I get html files with only the stations listed and no program data.
>>
>>Has anything changed in get_tv_grid_xmltv recently?
>>
>>
>>*** Resolution ***
>>
>>'http://docs.tms.tribune.com/tech...xtvd.wsdl'
>>was not a valid url anymore.
>>
>>'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelive
>>ry.wsdl'
>>
>>is the valid url for $dd_service in tv_grab_na_dd.
>>
>>----- Original Message -----
>>From: "Rick Bolen (GM)" <[hidden email]>
>> >
>> > Is the "http://docs.tms.tribune.com/tech...xtvd.wsdl" url currently valid?
>> >
>>
>>
>>----------------------------------------------------------------------------
>>--
>>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>>The future of the web can't happen without you.  Join us at MIX09 to help
>>pave the way to the Next Web now. Learn more and register at
>>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>>________________________________________________________
>>To unsubscribe from this list, go to:
>>http://sourceforge.net/mail/?group_id=1365
>>
>>
>>
>>------------------------------------------------------------------------------
>>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>>The future of the web can't happen without you.  Join us at MIX09 to help
>>pave the way to the Next Web now. Learn more and register at
>>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>>________________________________________________________
>>To unsubscribe from this list, go to:
>>http://sourceforge.net/mail/?group_id=1365


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Rick Bolen(gm)
In reply to this post by Rick Bolen(gm)
I've gotten get_tv_grid_xmltv to add the subchannel number to the
$channel_number var before the commits to the DBM. So now there's a unique
channel number\ID that is pumped into DBM_index to match program data
entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
but still no program data is posted.

Do I need to run another program to populate the program data, or does
get_tv_grid_xmltv build the whole web page for tv data?

Thanks,

Rick

----- Original Message -----
From: "Rick Bolen (GM)" <[hidden email]>
> There's other factors at work here. My SD data is for over-the-air digital
> broadcasters. Standard tv channels are now further divided into
sub-channels
> (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is not
> discerning this, and only recognizes\lists one (sub)channel... and I
haven't
> figured out how it matches programme info to a specific channel yet, but
it
> won't likely match pgm info to subchannels before it discerns subchannels.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Timothy Spaulding
My XMLTV runs every day and I don't get channel data in the web page either.  This has been the case since I began using XMLTV (the new code) a while back.  However, the favorite TV show announcements do have channel/show data and that is what I use.

I am not aware of an additional program/step to get the web page populated correctly.

-----Original Message-----
From: Rick Bolen (GM) [mailto:[hidden email]]
Sent: Sunday, December 07, 2008 12:51 AM
To: The main list for the MisterHouse home automation program
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...

I've gotten get_tv_grid_xmltv to add the subchannel number to the
$channel_number var before the commits to the DBM. So now there's a unique
channel number\ID that is pumped into DBM_index to match program data
entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
but still no program data is posted.

Do I need to run another program to populate the program data, or does
get_tv_grid_xmltv build the whole web page for tv data?

Thanks,

Rick

----- Original Message -----
From: "Rick Bolen (GM)" <[hidden email]>
> There's other factors at work here. My SD data is for over-the-air digital
> broadcasters. Standard tv channels are now further divided into
sub-channels
> (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is not
> discerning this, and only recognizes\lists one (sub)channel... and I
haven't
> figured out how it matches programme info to a specific channel yet, but
it
> won't likely match pgm info to subchannels before it discerns subchannels.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03
In reply to this post by Rick Bolen(gm)

get_tv_grid_xmltv is the only app building the web pages.

RickS

At 12:51 AM 12/7/2008, Rick Bolen \(GM\) wrote:

>I've gotten get_tv_grid_xmltv to add the subchannel number to the
>$channel_number var before the commits to the DBM. So now there's a unique
>channel number\ID that is pumped into DBM_index to match program data
>entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
>but still no program data is posted.
>
>Do I need to run another program to populate the program data, or does
>get_tv_grid_xmltv build the whole web page for tv data?
>
>Thanks,
>
>Rick
>
>----- Original Message -----
>From: "Rick Bolen (GM)" <[hidden email]>
> > There's other factors at work here. My SD data is for over-the-air digital
> > broadcasters. Standard tv channels are now further divided into
>sub-channels
> > (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is not
> > discerning this, and only recognizes\lists one (sub)channel... and I
>haven't
> > figured out how it matches programme info to a specific channel yet, but
>it
> > won't likely match pgm info to subchannels before it discerns subchannels.
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Mickey Argo-2
In reply to this post by Timothy Spaulding
Yes, I also had favorite shows announcing but no tv grid.  Replacing '6pm'
with 'all' on line 185 made the web pages build with channel data for me.

The only other change I made to get_tv_grid_xmltv was on line 313; I changed
4000 to 40 so that the page would always rebuild.

Mickey Argo

-----Original Message-----
From: Timothy Spaulding [mailto:[hidden email]]
Sent: Sunday, December 07, 2008 7:59 AM
To: The main list for the MisterHouse home automation program
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...

My XMLTV runs every day and I don't get channel data in the web page either.
This has been the case since I began using XMLTV (the new code) a while
back.  However, the favorite TV show announcements do have channel/show data
and that is what I use.

I am not aware of an additional program/step to get the web page populated
correctly.

-----Original Message-----
From: Rick Bolen (GM) [mailto:[hidden email]]
Sent: Sunday, December 07, 2008 12:51 AM
To: The main list for the MisterHouse home automation program
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...

I've gotten get_tv_grid_xmltv to add the subchannel number to the
$channel_number var before the commits to the DBM. So now there's a unique
channel number\ID that is pumped into DBM_index to match program data
entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
but still no program data is posted.

Do I need to run another program to populate the program data, or does
get_tv_grid_xmltv build the whole web page for tv data?

Thanks,

Rick

----- Original Message -----
From: "Rick Bolen (GM)" <[hidden email]>
> There's other factors at work here. My SD data is for over-the-air
> digital broadcasters. Standard tv channels are now further divided
> into
sub-channels
> (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is
> not discerning this, and only recognizes\lists one (sub)channel... and
> I
haven't
> figured out how it matches programme info to a specific channel yet,
> but
it
> won't likely match pgm info to subchannels before it discerns subchannels.


----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365


----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03

Mickey, can you change your get_tv_grid_xmltv to the one I posted and
let me know what happens?

At 11:23 AM 12/7/2008, Mickey Argo wrote:

>Yes, I also had favorite shows announcing but no tv grid.  Replacing '6pm'
>with 'all' on line 185 made the web pages build with channel data for me.
>
>The only other change I made to get_tv_grid_xmltv was on line 313; I changed
>4000 to 40 so that the page would always rebuild.
>
>Mickey Argo
>
>-----Original Message-----
>From: Timothy Spaulding [mailto:[hidden email]]
>Sent: Sunday, December 07, 2008 7:59 AM
>To: The main list for the MisterHouse home automation program
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>My XMLTV runs every day and I don't get channel data in the web page either.
>This has been the case since I began using XMLTV (the new code) a while
>back.  However, the favorite TV show announcements do have channel/show data
>and that is what I use.
>
>I am not aware of an additional program/step to get the web page populated
>correctly.
>
>-----Original Message-----
>From: Rick Bolen (GM) [mailto:[hidden email]]
>Sent: Sunday, December 07, 2008 12:51 AM
>To: The main list for the MisterHouse home automation program
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>I've gotten get_tv_grid_xmltv to add the subchannel number to the
>$channel_number var before the commits to the DBM. So now there's a unique
>channel number\ID that is pumped into DBM_index to match program data
>entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
>but still no program data is posted.
>
>Do I need to run another program to populate the program data, or does
>get_tv_grid_xmltv build the whole web page for tv data?
>
>Thanks,
>
>Rick
>
>----- Original Message -----
>From: "Rick Bolen (GM)" <[hidden email]>
> > There's other factors at work here. My SD data is for over-the-air
> > digital broadcasters. Standard tv channels are now further divided
> > into
>sub-channels
> > (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is
> > not discerning this, and only recognizes\lists one (sub)channel... and
> > I
>haven't
> > figured out how it matches programme info to a specific channel yet,
> > but
>it
> > won't likely match pgm info to subchannels before it discerns subchannels.
>
>
>----------------------------------------------------------------------------
>--
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
>
>
>----------------------------------------------------------------------------
>--
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
>
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

Mickey Argo-2
OK...I changed out to what you sent in line on your email, and tried to make
sure I cleaned up the code for line breaks.

When running yours, I don't get any web pages built.  I don't get any error
messages either, so I'm not sure what is going on.

Try sending the actual file to misterhouse @ argohouse . Net

I'll also include (in line) my get_tv_grid_xmltv

One thing I did notice was the XMLTV::Version is different but I don't know
enough about Perl to know if this is significant.

Mickey Argo

#!/usr/bin/perl

# $Date: 2008-01-21 12:41:44 -0600 (Mon, 21 Jan 2008) $
# $Revision: 1300 $
#
#---------------------------------------------------------------------------
#  File:
#      get_tv_grid_xmltv
#  Description:
#      See help text below
#  Author:
#      Bruce Winter    [hidden email]   http://misterhouse.net
#  Latest version:
#      http://misterhouse.net/mh/bin
#  Change log:
#    04/25/98  Created.
#    02/--/02  Tom Witmer ([hidden email]) adds mods
# 11/--/07  Jim Duda changed to work with XMLTV and
schedulesdirect.org
# 11/--/07  Rick Steeves ([hidden email]) updated to build
#   ia5 web pages from the XMLTV data
#---------------------------------------------------------------------------

#---------------------------------------------------------------------------
#  Purpose:
#      For the days/times/channels listed, retrieve the listing data
#   from an external XML file generated by xmltv from
schedulesdirect.org and
#      store it in the listings DB.
#
#  Notes for the future:
#    - ASSUMPTION: Shows in grid do not indicate their true start or end
#      times, if they cross grid boundaries. This is somewhat avoidable
#      by choosing long durations (6 hours max), and might be partially
#      fixable by adjusting shows that seem to "repeat". (This won't work
#      for shows that are listed twice in a row, however!)
#    - Would be nice to get only primetime data for weekdays, and all
#      data for weekends. This is not yet incorporated.
#
# Requires that a current XML files exists pulled from
schedulesdirect.org
# using XMLTV. This file needs to be updated by running xmltv on a
daily
# basis for udpates.
# The file location should be defined in mh.private.ini as tv_xml.
# Example:
# tv_xml= f:/temp/tv.xml
#
#---------------------------------------------------------------------------

use strict;

#======================================================================
# Version info
#======================================================================
my($Pgm_Path, $Pgm_Name, $Version);
BEGIN {
   ($Version) = q$Revision: 1300 $ =~ /: (\S+)/; # Note: revision number is
auto-updated by cvs
   ($Pgm_Path, $Pgm_Name) = $0 =~ /(.*)[\\\/](.*)\.?/;
   ($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
   eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe
works
}

use XMLTV::Version '$Id: get_tv_grid_xmltv 1300 2008-01-21 18:41:44Z
mattrwilliams $ ';
use IO::File;
use Date::Manip; Date_Init('TZ=UTC');
use POSIX 'tmpnam';
use Getopt::Long;
use XMLTV qw(best_name);
use vars '%config_parms';  # Not a my, as called from handy_net_utils
use Time::Local;

#======================================================================
# Variable declarations and other init
#======================================================================
# Globals
#
#my ( %parms, $infile, %channels_skip, %channels_keep, $channel_data );
my ( %parms, $infile, $channel_data );
my (@hours, @uas);
my ($dbm_file, $dbm_file2);
my (%DBM, %DBM2, %DBM_channel, %DBM_html, %DBM_index);  # DBM_html is
extended data for HTML
my (%showtimes);
my @weekday  = qw (Sun Mon Tue Wed Thu Fri Sat);

#Disabled because this comes from Schedulesdirect.org anyway
#%channels_skip = ();
#%channels_keep = ();

#======================================================================
# Check invocation options, and print usage message if necessary
#======================================================================
if (!&GetOptions(\%parms, "h", "help", "infile=s", "outfile=s", "outdir=s",
   "db=s", "keep=s", "skip=s", "channel_max=s", "channel_min=s",
   "debug", "label=s", "keep_old","purge=s",
   "days=s", "day=s", "hour=s") or @ARGV or
   ($parms{h} or $parms{help}))
{
   print<<eof;
$Pgm_Name reads a TV grid/schedule from an XML file generated from
(schedulesdirect.org) for it to be used by the MisterHouse program
to create VCR and TV event reminders.

Creates a DBM for use by get_tv_info.
  Version: $Version
  Usage:
   $Pgm_Name [options]
   -h        => This help text
   -help     => This help text
   -db   xyz      => xyz is the database (tv, sat, cable, default tv)
   -name xyz      => xyz is the name of the service (TV, Dish Network,
                     Cable, etc) default is TV
   -day xyz      => xyz is the day  to get/filter.  Default is today.
   -hour xyz     => xyz is the hour to get/filter.  Default is 6pm.  Can
also
                    be 'all' to get all hours.
   -days xyz     => xyz is the number of days to get/filter, starting
                    with -day.
   -channel_max xyz  => Channels above xyz will be dropped.  Default is
9999.
   -channel_min xyz  => Channels below xyz will be dropped.  Default is 1.
   -infile  xyz  => xyz is  input file, and XML file from XMLTV.
   -outfile xyz  => xyz the filtered output file.
                    Default is -outdir/day_hour.html
   -outdir  xyz  => xyz the directory the outfiles will be put in.
                    Default is mh.ini parm html_dir/{db}
   -purge  xyz  => Purge entries older than xyz days old.
   -label xyz    => Use xyz as the link lable.  Default is "VCR".
                    To disable, set to none (-label none).
   -redo         => Rebuilds the web page, even if a recent file it exits
   -timebars xyz   => Number of channels between timebars in output table.
                    Default is 5.
   -keep_old     => Do NOT delete data from the DBM that is one month older
                    than todays date
   -debug        => turn on debug info

  Example:
   $Pgm_Name -infile /media/xmtv/TV.xml

eof
  exit;
}

sub days_from_now
{
   my ($day_time, $days) = @_;
   my $day_time2 = $day_time + $days * 60 * 60 * 24;
   my ($day, $month, $year, $down) = (localtime($day_time2))[3,4,5,6];
   my $dow = (qw(Sunday Monday Tuesday Wednesday Thursday Friday
Saturday))[$down];

   $month++;
   $year += 1900;
   $day = sprintf("%02d", $day);
   return ($dow, $down, $day, $month, $year);
}


#======================================================================
# SUB: hour_to_min
# required to figure out the column width
# the old way you knew the column witdh from parsing the HTML
#======================================================================
sub hour_to_min
{
   my ($time) = @_;
   my ($hour, $minute) = $time =~ /(\d+):(\d+)/;
   my $minutes = $minute + $hour * 60;
   return $minutes;
}

#======================================================================
# SUB: setup
# Process invocation parameters prior to doing any real work
#======================================================================
sub setup
{
   &main::read_mh_opts(\%config_parms, $Pgm_Path);

   #------------------------------------------------------------
   # Process Incoming Parameters, defaulting as necessary
   #------------------------------------------------------------
   $parms{purge}   = 2 unless $parms{purge};
   $parms{timebars} = 5 unless $parms{timebars};
   $parms{days}    = 1 unless $parms{days};
   $parms{db}      = 'tv'  unless $parms{db};
   $parms{outdir}  ="$config_parms{html_dir}/$parms{db}"
      unless $parms{outdir};
   $parms{name}   = 'TV' unless  $parms{name} ;
   $parms{hour}    = $config_parms{$parms{db}.'_hours'} unless $parms{hour};

    $parms{hour} = 'all' unless $parms{hour};
    if (lc($parms{hour}) eq 'all') {
        @hours = qw(02 06 10 14 18 22);
                        %showtimes = (
                        $hours[0] => ['02:00 AM', '02:30 AM', '03:00 AM',
'03:30 AM', '04:00 AM', '04:30 AM', '05:00 AM', '05:30 AM'],
                        $hours[1] => ['06:00 AM', '06:30 AM', '07:00 AM',
'07:30 AM', '08:00 AM', '08:30 AM', '09:00 AM', '09:30 AM'],
                        $hours[2] => ['10:00 AM', '10:30 AM', '11:00 AM',
'11:30 AM', '12:00 PM', '12:30 PM', '1:00 PM', '1:30 PM'],
                        $hours[3] => ['2:00 PM', '2:30 PM', '3:00 PM', '3:30
PM', '4:00 PM', '4:30 PM', '5:00 PM', '5:30 PM'],
                        $hours[4] => ['6:00 PM', '6:30 PM', '7:00 PM', '7:30
PM', '8:00 PM', '8:30 PM', '9:00 PM', '9:30 PM'],
                        $hours[5] => ['10:00 PM', '10:30 PM', '11:00 PM',
'11:30 PM', '00:00 AM', '00:30 AM', '01:00 AM', '01:30 AM'],
                );
    }
    elsif (lc($parms{hour}) eq 'all_by_3') {
        @hours = qw(02 05 08 11 14 17 20 23);
    }
    elsif (1 < (@hours = split(',', $parms{hour}))) {
        for (@hours) {
            $_ = sprintf("%02d", $_);         # force hour to be  zero
padded
        }
    }
    elsif (1 < (@hours = split(',', $parms{hour}))) {
    }
    else {
        my ($hour, $am_pm) = $parms{hour} =~ /(\d+) *(\S*)/;
        $hour += 12 unless lc($am_pm) eq 'am' or $hour == 12;
        @hours = (sprintf("%02d", $hour));
    }

   $parms{duration}= $config_parms{$parms{db}.'_duration'} if (
$config_parms{$parms{db}.'_duration'} );
   $parms{duration}= 4 unless ( $parms{duration} );

   $parms{label} = "VCR" unless $parms{label};  # This can also be an image
link
   $parms{days}  = 1 unless $parms{days};
   $parms{redo}  = 1;
   $parms{duration}  = 6 unless $parms{duration};

   # Set up DBM files
   $dbm_file  = "$config_parms{data_dir}/$parms{db}_programs.dbm";
   $dbm_file2 = "$config_parms{data_dir}/$parms{db}_channels.dbm";
   # Setting up for HTML output
   print "Tieing to $dbm_file\n";
   use Fcntl;
   use DB_File;
   tie (%DBM,  'DB_File',  $dbm_file,  O_RDWR|O_CREAT, 0666) or print
"\nError, can not open dbm file $dbm_file: $!";
   tie (%DBM2, 'DB_File',  $dbm_file2, O_RDWR|O_CREAT, 0666) or print
"\nError, can not open dbm file $dbm_file2: $!";
   #
   #$parms{debug} = 1;
}

#======================================================================
# SUB: createOutputDirs
# Create any directories/files that need creating prior to downloads
#======================================================================
sub createOutputDirs
{
   mkdir $parms{outdir}, 0777 unless -d $parms{outdir};

   if ( ! -d $parms{outdir} )
   {
      print "FAILED TO MAKE DIR: $parms{outdir} \n";
   }
   if ( ! -d $parms{outdir}."/logos" )
   {
      print "XMLTV Logos missing: $parms{outdir}/logos \n";
   }
}


#======================================================================
# SUB: processRawFile
# Takes the DBM_html array and builds the HTML pages
#======================================================================
sub processRawFile
{
        createOutputDirs();
        my $day_time = time;
        #------------------------------------------------------------
        # For each number of days we're asked to retrieve...
        #------------------------------------------------------------
        for my $count ( 0 .. $parms{days} )
        {
       
#------------------------------------------------------------
                # Calculate the date/time of this day
       
#------------------------------------------------------------
                my @day_data = days_from_now( time, $count );
                my ($dow, $down, $day, $month, $year) = split(' ',
"@day_data");
                my $startDay = ${month}."/".${day}."/".${year};

                # Calculate the epoch time for the beginning of this day.
                # Lets us do date/time math while not having to worry so
much
                # about end of day/month/year crossovers
                my $month_epoch = $month -1;
                my $day_epoch = timelocal(0,0,0,$day,$month_epoch,$year);

       
#------------------------------------------------------------
                # For each hour we're supposed to retrieve...
       
#------------------------------------------------------------
                for my $startHour( @hours )
                {
      my $hour = $startHour;
                                my $channel_number = '';
                                my $channel_name = '';
                                my $current_time_bar = '';  
                                my $rowOfLastTimeBar = 0;
                                my $rowsInCurrentOutTable  = 0;

                                # Convert the starting grid hour to epoch
seconds
                                #    from AM/PM to 24
                                my $grid_start_epoch =
ampm_to_hour24($hour);
                                #    to seconds of the particular day
                                $grid_start_epoch =
&hour_to_min($grid_start_epoch) * 60;
                                #    and add from midnight
                                $grid_start_epoch = $grid_start_epoch +
$day_epoch;

                                # And calculate the end of the end of the
grid in epoch seconds
                                # A hack for now. Needs to caculate based of
the actual end
                                my $grid_end_epoch = $grid_start_epoch +
14400;

 
#------------------------------------------------------------
      # Calculate the name of the output file
 
#------------------------------------------------------------
      my $outfile = "$parms{outdir}/${day}_${startHour}.html";

 
#------------------------------------------------------------
      # If output file already exists, and is recent enough, use
      # keep it instead of rebuilding it.
 
#------------------------------------------------------------
      if ( (-e $outfile) and (8 > -M $outfile) and
      (40 > -s $outfile) and !$parms{redo} and
!$parms{debug} )
      {
      print "Reusing: $outfile\n";
      } else {

                                print "Processing array to $parms{outdir}
$outfile\n" if ($parms{debug});

       
#------------------------------------------------------------
                                # Open files and start the output HTML
       
#------------------------------------------------------------
                                open (OUT, ">$outfile") || die "Error, could
not open file $outfile: $!\n";
                                print OUT<<eof;
<HTML>
<HEAD>
<TITLE>$parms{name} Schedule for $dow, $month/$day/$year</TITLE>
<meta http-equiv="Expires" content="Fri, Jun 12 1981 08:20:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
</HEAD>
<body bgcolor=gray>
eof

       
#------------------------------------------------------------
                                # Create date/time menu selection javascript
header to page.
                                # (Lets user jump to a different date/time)
       
#------------------------------------------------------------
                                &make_index($hour, $down, $day, $day_time);
                               
                                # This should also really go into make_index
       
##############################################
                                print OUT qq|<table border="1"
BGCOLOR="#FFFFFF" CELLPADDING="2" CELLSPACING="1" WIDTH="">\n|;
                                $current_time_bar = qq|<tr><td colspan=2
align="center" bgcolor="#663366" width="60"><a
href="/tv/$day\_$hour.html"><input border="0" width=60 height=30
type="image" name="earlier" src="/tv/logos/leftArrow.gif"
value="earlier"></a></td>\n|;
                                foreach my $showtime (@{ $showtimes{$hour}})
{
      $current_time_bar .= qq|<td
bgcolor="#ffffff"><center><font face="arial, helvetica" size="2"
color=""><b><nobr>$showtime</nobr></b></center></font></td>\n|;
                                }
       
                                $current_time_bar .= qq|<td colspan=2
align="center" bgcolor="#663366" width="60"><a
href="/tv/$day\_$hour.html"><input border="0" width=60 height=30
type="image" name="later" src="/tv/logos/rightArrow.gif"
value="later"></a></td>\n|;
                                $current_time_bar .= "</tr>\n";
                                print OUT $current_time_bar;
                               
                                # end of what should go into make_index
                                ########################################
                               
                                # Generate the listing of show times.
                                # Loop through for each channel in sorted
order
                                foreach my $key (sort { $a <=> $b }
(keys(%DBM_channel))) {
                                        # Check for every channel
                                        # if past midnight adjust the date
to "tomorrow"
                                        my ($channel_number, $channel_name,
$channel_affiliate, $channel_image, $channel_ID) = split($;,
$DBM_channel{$key});
                                        my $channel_number_display =
$channel_number;
                                        # pull out the zero for the low
channels - needed it for the sort tho
                                        #$channel_number_display =~ s/^0//;
                                        my $show_found = 0;  # when the
beginning of the channel
 
# has nothing in it, to fill in the blanks
                                        my $colspan = 0;  # keep track of
how wide a show is
                                        my $colspancount = 0;  # track width
of ttl grid
                                        my $show_found = 0;  # has a show
been found yet
                                        my $max_col_span = 8;  # Maximum #
of columns in table
                                        # so we can figure out when the day
flips
                                        my $its_late = 0;
                                       
                                        my $row_started = 0;
               
                                        $rowsInCurrentOutTable++;
                                        # Print the channel information on
the left
                                        print OUT qq|<tr width="100%"><td
bgcolor="#ffffff" align="center"
colspan="2">$channel_image$channel_number_display<br>$channel_name</td>\n|;
                                       
                                        # Check each defined interval to see
if a show is starting
                                        foreach my $showtime (@{
$showtimes{$hour}}) {
                                                #
                                                # Calculate the starting
hour in epoch time
                                                # Convert the showtime start
to epoch seconds
                                                #    from AM/PM to 24
                                                my $showtime_epoch =
ampm_to_hour24($showtime);
                                                #    to seconds of the
particular day
                                                $showtime_epoch =
&hour_to_min($showtime_epoch) * 60;
                                                # if we're at the beginning
of a day, add a day of time, because it's now tomorrow
                                                if (($showtime eq '00:00
AM') || ($its_late)) {
                                                        $showtime_epoch =
$showtime_epoch + 86400;
                                                        $its_late = 1;
                                                }
                                                $showtime_epoch =
$showtime_epoch + $day_epoch;

                                                my ($pgm_date,$pgm_time) =
&convert_epoch_to_time($showtime_epoch);
                                                my $db_key = join($;,
$channel_number, $pgm_date, $pgm_time);
                                               
                                                # If there is a value for
the half hour interval
                                                # figure out how long the
show is and print the HTML
                                                if ($DBM_html{$db_key}) {
                                                        $show_found = 1;
                                                        my ($time_end,
$pgm_name, $pgm_title, $pgm_air, $time_start, $time_start_adj,
$time_end_adj, $pgm_rating, $pgm_desc, $pgm_date_end, $epoch_start,
$epoch_end, @pgm_category) = split($;, $DBM_html{$db_key});
                                                       
                                                        # calculate how many
columns the show will take up.
                                                        # using the
difference in two times for determining grid width.
                                                        $colspan =
int(($epoch_end/60 - $epoch_start/60)/30);
                                                        # If the show is
longer than is left on the table,
                                                        #     decrease width
to available space
                                                        if (($colspancount +
$colspan) > $max_col_span) {
                                                                do {
$colspan = $colspan -1; } until (( ($colspancount + $colspan) <=
$max_col_span) | $colspan < 2 );
                                                        }
                                                        $colspancount =
$colspancount + $colspan;
       

                                                        # Define the program
listing for display to the grid
                                                        print OUT
&display_program($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channe
l_number,$time_start,$time_start_adj,$time_end,$pgm_date,
$colspan,@pgm_category);
                                                       
                                                } elsif ((!($show_found)) &
(!($row_started))) {  
                                                        # If we didn't find
a show go look in the last grid
                                                        # see if it's in the
array searching backward for a few hours
                                                        my $grid_time_search
= $grid_start_epoch;
                                                        for (my $i=1; $i <=
8; $i++) {
                                                                # Figure out
when the last time was
                                                                # back up
time 30 minutes
       
$grid_time_search = $grid_time_search - (30 * 60); # Backup 30 minutes
                                                                my
($pgm_date_loop, $pgm_time_loop) =
&convert_epoch_to_time($grid_time_search);
                                                                #Build a key
                                                                my
$search_key = join($;, $channel_number, $pgm_date_loop, $pgm_time_loop);
                                                                if
($DBM_html{$search_key}) {
                                                                        #
then hey we found it
                                                                        my
($time_end, $pgm_name, $pgm_title, $pgm_air, $time_start, $time_start_adj,
$time_end_adj, $pgm_rating, $pgm_desc, $pgm_date_end, $epoch_start,
$epoch_end, @pgm_category) = split($;, $DBM_html{$search_key});
                                                                        #
Show has to end before the beginning of grid or we don't really care and
it's a lost cause
                                                                        if
($epoch_end > $grid_start_epoch) {
       
# Figure out the column width
       
$colspan = int(($epoch_end/60 - $grid_start_epoch/60)/30);
       
# and of course display the info
       
print OUT
&display_program($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channe
l_number,$time_start,$time_start_adj,$time_end,$pgm_date,$colspan,@pgm_categ
ory);
       
$show_found = 1;
       
$row_started = 1;
       
$i = 10; # Kick ourselves out of the loop because we found it
       
$colspancount = $colspan;
                                                                        }
                                                                }
                                                                # and if not
back up another 30 minutes
                                                        }
                                                        # Otherwise just
leave it blank and do the best you can
                                                        if (!($show_found))
{
                                                                print OUT
qq|<td bgcolor="#ffffff" colspan="1" width="10%" valign="top"></td>\n|;
       
$colspancount++;
                                                                $row_started
= 1;
                                                        }
      } elsif (!($show_found)) {

                                                        print OUT qq|<td
bgcolor="#ffffff" colspan="1" width="10%" valign="top"></td>\n|;
                                                        $colspancount++;
                                                        $row_started = 1;
                                                }

      $row_started = 0;
      }
                                        if ($colspancount < $max_col_span )
{  # fix for blanks at the end of the channel
                                                my $colspan = $max_col_span
- $colspancount;
      print OUT qq|<td bgcolor="#ffffff"
colspan="$colspan" width="$colspan| . qq|0%" valign="top"></td>\n|;
      }
                                        # print the channel information on
the right
                                        print OUT qq|<td bgcolor="#ffffff"
align="center"
colspan="2">$channel_image$channel_number_display<br>$channel_name</td>\n</t
r>\n|;
       
#------------------------------------------------------------
                                        # Do we need to generate a new
timebar?
       
#------------------------------------------------------------
                                        if ( $rowsInCurrentOutTable %
$parms{timebars} == 0 ) {
                                                print OUT $current_time_bar;
                                        }
                                }
                                print OUT "</table></body></html>\n";

                                close OUT;

       
#------------------------------------------------------------
                                # Find listing for "prime time" and make it
the default index file.
                                # Also, email it to someone if we have the
means of doing so.
       
#------------------------------------------------------------
                                if ( $day == (localtime(time))[3] and
$startHour >  17 and $startHour <= 20) {
                                        use File::Copy;
                                        copy($outfile,
"$parms{outdir}/index.html");
                                        print "Copied $outfile  to
$parms{outdir}/index.html\n" if $parms{debug};
                                        if ($parms{mail_to} ) {
                                                &mail_file($parms{mail_to},
$parms{mail_server}, $outfile, "$parms{name} Schedule for $dow,
$month/$day/$year");
                                        }
                                }
                        }
                }
        }
}

#======================================================================
# SUB: make_index
# Create the index table, for the next 2 weeks, and for other hours in
# this day
#======================================================================
sub make_index {
   my ($hour, $down, $day, $day_time) = @_;
   print OUT "<center>\n<table border=1 width=100%>\n<tr>\n<td
align=left>\n";      ### DW: remove bgcolors

   print OUT "<font face=arial size=+1 color=white> Listings for
$parms{name} </td><td align=right>";
   print OUT "<FORM>";

   #----------------------------------------------------------------------
   # Notes to any who care: Use different window targets for different
   # results:
   #  _blank= new browser window
   #  _self = current browser window
   #  _parent = window superior to the frame
   #  _top = cancels all frames, loads in full browser window
   #  In this case, I'm using the named "output" frame, which seems to
   #  be the friendliest way to do this (in my own humble opinion.)
   #  Feel free to change this if you like.
   #----------------------------------------------------------------------
   print OUT "<SELECT NAME=url
onchange=window.open(this.options[this.selectedIndex].value,'main')>\n";
   #my $dow_start = -$down - 7;
   my $dow_start =  -$parms{purge};
   my $dow_stop  = 7;
#  my $dow_stop  = $parms{days} -1;
   for my $count ($dow_start .. $dow_stop) {
       my ($dow2, $dow2n, $day2, $month2, $year2) =
&days_from_now($day_time, $count);
       print OUT "<option value='/" . $parms{db} . "/${day2}_$hour.html'";

       if ($day2 == $day)  {
         print OUT " Selected ";
       }
       print OUT ">$dow2, $month2/$day2\n";
   }
   print OUT "</select>\n";
   print OUT "<SELECT NAME=tvtime
onchange=window.open(this.options[this.selectedIndex].value,'main')>\n";

   for my $hour2 (@hours) {
       my $hour2_ampm;

       if ($hour2 == 12) {
           $hour2_ampm = "12 pm";
       }
       elsif ($hour2 > 12) {
           $hour2_ampm = $hour2 - 12 . " pm";
       }
       elsif ($hour2 == 0) {
           $hour2_ampm = "12 am";
       }
       else {
           $hour2_ampm = $hour2 + 0 . " am";
       }
#       $hour2_24 = '0' . $hour2 if $hour2 < 10;

        print OUT "<option value='/" . $parms{db} .
"/${day}_${hour2}.html'";
        if ($hour2 == $hour)  {
          print OUT " Selected ";
        }

        print OUT ">$hour2_ampm\n";

#        print OUT "<td align=center bgcolor=white><a
href=/tv/${day}_${hour2}.html>$hour2_ampm</a><td>\n";
   }
   print OUT "</select>\n</td>\n";
   print OUT "</tr>\n</form></table></center>\n";
}


#======================================================================
# SUB: delete_old_data
# Delete data that doesn't fall into the following range:
#   $parms{purge} days ago through 7 days from now
#======================================================================
sub delete_old_data {
   my @dates;
   for (-14..$parms{purge}) {
      my ($dow, $down, $day, $month) = &days_from_now(time, -$_ );
      push @dates,"$month/$day";
   }
   print "Deleting old data more than $parms{purge} days ago ...\n";
   print "Keeping these dates ONLY: @dates\n";

   my ($key,$value);
   while (($key,$value) = each %DBM) {
      my ($channel, $date, $time)=split($;, $key);
      # don't delete it if the date matches
      next if (grep (/^$date$/, @dates) > 0);
      delete $DBM{$key};
   }

   print "Compressing non-purged data\n";

   my $dbm_file_temp=$dbm_file.'.temp';

   unlink $dbm_file_temp if -e $dbm_file_temp;

   my %DBM_TEMP;
   tie (%DBM_TEMP,  'DB_File',  $dbm_file_temp,  O_RDWR|O_CREAT, 0666) or
die "Error, can not open dbm file $dbm_file_temp: $!";

   # copy hash info over to new DBM file
   %DBM_TEMP=%DBM;

   # untie these two hashes
   untie %DBM;
   untie %DBM_TEMP;

   # delete old DBM file
   rename ($dbm_file, $dbm_file.'.to.be.deleted') or die "can't rename to
.to.be.deleted: $!" ;
   rename $dbm_file_temp, $dbm_file or die "can't rename from temp to real:
$!";
   unlink $dbm_file.'.to.be.deleted';

   # clear hash
   undef %DBM;

   # retie hash
   tie (%DBM,  'DB_File',  $dbm_file,  O_RDWR|O_CREAT, 0666) or die "Error,
can not open dbm file $dbm_file the second time: $!";
   print "Finished deleting old data\n";
}

sub delete_old_data_html {
   #my ($down, $down, $day, $month) = &days_from_now(time, -28);
   my ($dow, $down, $day, $month) = &days_from_now(time, $parms{purge} * -1
);
   my $pgm_date = "$month/$day";
   print "Deleting old data from $parms{purge} days ago: $pgm_date ...\n";

   for my $hour (00 .. 27) {
       $hour = '0' . $hour if $hour < 10;
       my $outfile = "$parms{outdir}/${day}_${hour}.html";
       unlink $outfile if -f $outfile;
        }
}


#======================================================================
# fetchLoop
#======================================================================
sub fetchLoop
{
        #-------------------------------------------------------
        # Blow away the old data
        #-------------------------------------------------------
        &delete_old_data unless $parms{keep_old};
        &delete_old_data_html unless $parms{keep_old};
        my ($pgm_date);
        print "Reading in XMLTV file (takes a bit)...\n" if $parms{debug};
        my ($encoding, $credits, $ch, $progs) =
@{XMLTV::parsefiles($parms{infile})};
       
        #
        # Read all the channel-associated information into hash %DBM2.
        #
        my $langs = [ 'en' ];
        foreach (values %$ch) {
                my $channel_affiliate = ''; # assume it's not an affiliate
station
                my $channel_image = ''; # assume there's no image
for the channel
                my $channel_image_path;
                my $channel_ID = $_->{id};  # XMLTV Channel ID
                # Pick the best name for the channel
                my ($channel, $lang) = @{XMLTV::best_name($langs,
$_->{'display-name'})};
                my ($channel_number, $channel_name) = $channel =~ /^(.*)
(.*)/;
                # Check to see if the station is a network affiliate.
                foreach my $key (@{$_->{'display-name'}}) {
                        my $key2 = "@$key";
                        if ($key2 =~ /Affiliate/) {
                                ( $channel_affiliate ) = $key2 =~ /(^.*)
Affiliate/;
                        }
                        else { $channel_affiliate = ''; }
                }
                # Check to see if there's an associated image for the
channel
                if ($channel_affiliate) {
                        # for some reason some of the channel icons are
gifs, others jpgs.
                        # Check for both
                        $channel_image_path = $parms{outdir} . '/logos/' .
lc($channel_affiliate) . '.gif';
                        if ( (-e $channel_image_path) ) {
                                $channel_image = qq|<img
src="/tv/logos/$channel_affiliate.gif"><br>|;    
                        } else {
                                $channel_image_path = $parms{outdir} .
'/logos/' . lc($channel_affiliate) . '.jpg';
                                if ( (-e $channel_image_path) ) {
                                        $channel_image = qq|<img
src="/tv/logos/$channel_affiliate.jpg"><br>|;    
                                }
                                if (!($channel_image)) { $channel_image =
"$channel_affiliate<br>"; }
                        }
                }
                # and if it's not an affiliate it could still have an icon.

                else {
                        $channel_image_path = $parms{outdir} . '/logos/'.
lc($channel_name) . '.jpg';
                        if ( (-e $channel_image_path) ) {
                                $channel_image = qq|<img
src="/tv/logos/$channel_name.jpg"><br>|;
                        }  
                }

                $DBM2{$channel_number} = $channel_name;
                       
                # set the channel length to 2 characters for HTML sorting.
                # needs to be longer for > 100 channels
                #$channel_number = sprintf("%02s", $channel_number);
                my $db_data = join($;, $channel_number, $channel_name,
$channel_affiliate, $channel_image, $channel_ID);
  $DBM_channel{$channel_number} = $db_data;
  # DBM_index cross references between channels and programs
                $DBM_index{$channel_ID} = join($;, $channel_number,
$channel_ID);
        }
       
        #
        # Read all the program-associated information into hash %DBM.
        # and %DBM_html.
        #
        foreach (@$progs) {
                my $lang = '';
                my $channel_ID = $_->{channel};
                my ($channel_number, $channel_ID) = split($;,
$DBM_index{$channel_ID});
               
                my ($time_end_XML) = $_->{stop};
                my ($pgm_date_end, $time_end ) = &time_from_XML($_->{stop});
                my $epoch_end = &convert_XML_to_epoch($time_end_XML);
       
                my ($time_start_XML) = $_->{start};
                my ($pgm_date, $time_start ) = &time_from_XML($_->{start});
                my $epoch_start = &convert_XML_to_epoch($time_start_XML);
               
                my $time_start_adj = &time_adj($time_start);
                my $time_end_adj = &time_adj($time_end);
               
                my $pgm_air = substr $_->{date},0,4;
               
                my $pgm_name = '';
                if (defined $_->{title}) {
                        foreach (@{$_->{title}}) { ($pgm_name, $lang) = @$_;
}
                }
                my $pgm_title = '';
                if (defined $_->{'sub-title'}) {
                        foreach (@{$_->{'sub-title'}}) { ($pgm_title, $lang)
= @$_; }
                        $pgm_title = $pgm_title;
                }
                $pgm_name =~ s/  / /g;     # Drop extra spaces
                $pgm_name =~ s/\s+$//;     # remove trailing spaces
               
                my $pgm_desc = '';
                if (defined $_->{desc}) {
                        foreach (@{$_->{desc}}) { ($pgm_desc, $lang) = @$_;
}
                }
                my $pgm_rating = '';
                my $pgm_chip = '';
                my $pgm_other = '';
                if (defined $_->{rating}) {
                        foreach (@{$_->{rating}}) { ($pgm_rating, $pgm_chip,
$pgm_other) = @$_; }
                }
               
                my @pgm_category = ();
                my $lang = '';
                if (defined $_->{'category'}) {
                        foreach (@{$_->{'category'}} ) {
                                my ($category, $lang) = @$_;
                                push (@pgm_category, $category);
                        }
                }
               
                my $pgm_name_full;
                if ($pgm_title) {
                        $pgm_name_full = "$pgm_name: $pgm_title";
                } else { $pgm_name_full = $pgm_name; };
               
                #my $pgm_name_full = "$pgm_name: $pgm_title" if defined
$pgm_title;
                $pgm_name_full =~ s/  / /g;     # Drop extra spaces
                $pgm_name_full =~ s/\s+$//;     # remove trailing spaces
               
                # %DBM_html is an extended data set from %DBM, so we can
muck with it and
                # not screw with the actual database. Also would be much
bigger.
                my $html_key = join($;, $channel_number, $pgm_date,
$time_start_adj);
                my $html_data = join($;, $time_end, $pgm_name, $pgm_title,
$pgm_air, $time_start, $time_start_adj, $time_end_adj, $pgm_rating,
$pgm_desc, $pgm_date_end, $epoch_start, $epoch_end, @pgm_category);
                $DBM_html{$html_key} = $html_data;
                my $db_key = join($;, $channel_number, $pgm_date,
$time_start);
                #my $db_data= join($;, $time_end, $pgm_name_full,
$pgm_desc);
                my $db_data= join($;, $time_end, $pgm_name_full, 0);
                $DBM{$db_key} = $db_data;
                print "DBM: db key=$db_key\ndata=$db_data.\n" if
$parms{debug};
        }
}


# ========================================================
# sub ampm_to_hour24
# Converts time from clock time to 24 hour time
# ========================================================
sub ampm_to_hour24 {
    my ($hour, $min, $ampm) = @_[0] =~ /(\d+):?(\d*) *(\S*)/;
    $hour += 12 if uc($ampm) eq 'PM' and $hour  < 12;
    $hour -= 12 if uc($ampm) eq 'AM' and $hour == 12;
    $hour = sprintf("%02d", $hour);
         $min = "00" unless $min;
    $hour .= ":$min";
    return $hour;
}

# ========================================================
# sub time_from_XML
# Convert the XML time to clock time/date
# ========================================================
sub time_from_XML {
        my ($time) = @_;
        $time =~ /(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)\d\d -.*/;
        my @time_strip = ($1 , $2 , $3 , $4 , $5);
        my @time_split = ();
        foreach (@time_strip) {
                push (@time_split, sprintf("%02d", $_));
        }
        my ($yy,$mm,$dd,$hr,$mn) = @time_split;
        return ("$mm/$dd"),("$hr:$mn");
}

# ========================================================
# sub convert_XML_to_epoch
# Convert the XML time to epoch time
#     Note: "norms" the time
# ========================================================
sub convert_XML_to_epoch {
        my ($time_xml, $time) = @_;
        $time_xml =~ /(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d) -.*/;
        my ($year, $month, $mday, $hour, $min, $sec) = ($1 , $2 , $3 , $4 ,
$5, $6);
        $month = $month -1;  # to fix for XML vs timelocal
       
        # Norm the time
        if ($min >= 0 & $min <= 15) { $min=0; }
        elsif ($min > 15 & $min <= 45) { $min=30; }
        elsif ($min > 45 & $min <= 59) { $min=0; }

        $time = timelocal($sec,$min,$hour,$mday,$month,$year);
        return $time;
}

# ========================================================
# sub convert_epoch_to_time
# Switches epoch time to  date, 24 hour time
# ========================================================
sub convert_epoch_to_time {
        my ($epoch) = @_;
        my ($Second, $Minute, $Hour, $DayofMonth, $WrongMonth, $WrongYear,
$WeekDay, $DayofYear, $IsDST) = localtime($epoch);
        my $Month = $WrongMonth+1;
        my $Year = $WrongYear + 1900;
        #return ($Second, $Minute, $Hour, $DayofMonth, $Month, $Year,
$WeekDay, $DayofYear);
        return (sprintf('%02d/%02d', $Month,
$DayofMonth),sprintf('%02d:%02d', $Hour, $Minute));
}

# ========================================================
# sub convert_time_to_epoch
# Switches normal time to epoch time
# ========================================================
sub convert_time_to_epoch {
        my ($sec,$min,$hour,$mday,$month,$year) = @_;
        $month = $month -1;
        my $time = timelocal($sec,$min,$hour,$mday,$month,$year);
        return $time;
}

#======================================================================
# sub time_adj
# Fix the time so that shows have a consistent beginning or end
# ending exactly on the hour or half hour
#
# Dumb stations that decided to have shows start at, say, 11:35
# makes finding them in the index hard
#
# could have also solved this by reading through the index one minute
# at a time and in hindsight that might have been easier
#======================================================================
sub time_adj {
        my ($time) = @_;
        my ($hour, $min) = $time =~ /(.*):(.*)/;
        my $time_adj = '';
        if ( !( $min eq '30' | $min eq '00')) {
                if ($min >= 0 & $min <= 15) { $time_adj = $hour . ':00'; }
                elsif ($min > 15 & $min <= 45) { $time_adj = $hour . ':30';
}
                elsif ($min > 45 & $min <= 59) { $time_adj = $hour . ':00';
}
        } else {$time_adj = "$hour:$min";}
        return $time_adj;
}

#======================================================================
# sub pgm_color
# Selects the display color for programs based on their Category
# Picks the first category for the show
# Defaults to grey
#=====================================================================
sub pgm_color {
        # Determine the background color for the TV shows in the grid.
        my ($pgm_category) = @_;
        my $pgm_color = '#cccccc';  # Default color
        if ($pgm_category =~ /Action/) { $pgm_color = '#99ccff'; }
        elsif ($pgm_category =~ /Adventure/) { $pgm_color = '#99ccff'; }
        elsif ($pgm_category =~ /Bus/) { $pgm_color = '#9999cc'; }
        elsif ($pgm_category =~ /Children/) { $pgm_color = '#ccffcc'; }
        elsif ($pgm_category =~ /Comedy/) { $pgm_color = '#99ccff'; }
        elsif ($pgm_category =~ /Crime/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Drama/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Fantasy/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Game show/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Horror/) { $pgm_color = '#ff0000'; }
        elsif ($pgm_category =~ /Music/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Mystery/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /News/) { $pgm_color = '#9999cc'; }
        elsif ($pgm_category =~ /Paid/) { $pgm_color = '#ffffcc'; }
        elsif ($pgm_category =~ /Paranormal/) { $pgm_color = '#ffffcc'; }
        elsif ($pgm_category =~ /Reality/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Science/) { $pgm_color = '#0033ff'; }
        elsif ($pgm_category =~ /Shopping/) { $pgm_color = '#ffffcc'; }
        elsif ($pgm_category =~ /Sitcom/) { $pgm_color = '#ffff66'; }
        elsif ($pgm_category =~ /Special/) { $pgm_color = '#ccff33'; }
        elsif ($pgm_category =~ /Sports/) { $pgm_color = '#ffcc00'; }
        elsif ($pgm_category =~ /Suspense/) { $pgm_color = '#cccccc'; }
        elsif ($pgm_category =~ /Travel/) { $pgm_color = '#9999cc'; }
        elsif ($pgm_category =~ /Weather/) { $pgm_color = '#9999cc'; }
        else { $pgm_color = '#cccccc'; }
        return $pgm_color;
}

#======================================================================
# sub display_program
# Builds the HTML for an individual program display
#======================================================================
sub display_program {
        # Make the Display output for the tv_grid html page
        my
($pgm_name,$pgm_title,$pgm_desc,$pgm_air,$pgm_rating,$channel_number,$time_s
tart,$time_start_adj,$time_end,$pgm_date,$colspan,@pgm_category) = @_;
        my ($program, $pgm_category, $pgm_color,$time_wrong);

        # Format the program category, color-code as appropriate
        # Pick the color from the first listed category
        foreach my $key (@pgm_category) {
                # Filter out "series" - who really cares
                if (!($key =~ /Series/)) {
                        if ($pgm_category) { $pgm_category .= "/" . $key; }
                        else {
                                $pgm_category = $key;
                                $pgm_color = &pgm_color($pgm_category);
                        }
                }
        }

        $program = "<B>$pgm_name</B>";
        $program .= ": <i>$pgm_title</i>" if ($pgm_title);
        $program .= ".";
        $program .= " (" if (defined $pgm_category || defined $pgm_air);
        $program .= "$pgm_air, " if ($pgm_air);
        $program .= "$pgm_category" if defined $pgm_category;
        $program .= "). " if (defined $pgm_category || defined $pgm_air);
       
        $program .= " $pgm_desc" if defined $pgm_desc;
        $program .= " $pgm_rating" if defined $pgm_rating;
                                                       
        if ($parms{label} eq "VCR") {
                $program = q|<a href='/SET:last_spoken?$tv_grid?channel_| .
$channel_number . '_from_' . $time_start . '_to_' . $time_end . '_on_' .
$pgm_date . '_for_' . $pgm_name . q|'>VCR</a> for | . $program;
        }
        # When the start time isn't exactly right, display it
        if ($time_start ne $time_start_adj) {
                $time_wrong = qq|(<i>$time_start</i>) |;
        }
        $program = qq|<td bgcolor="$pgm_color" colspan="$colspan"
width="$colspan| . qq|0%" valign="top">$time_wrong$program</td>|;

        return $program;
}


#======================================================================
# M A I N
#======================================================================
setup();
if ( -1 == fetchLoop() )
{
   print "Grid Update failed\n";
   exit -1;
}

# If a HTML directory has been defined, parse through the $DBM arrays and
# generate the ia5 web pages
if ($parms{outdir}) { processRawFile(); }

print "Grid Update for $parms{db} complete\n";

untie %DBM;
untie %DBM2;
-----Original Message-----
From: Rick Steeves [mailto:[hidden email]]
Sent: Sunday, December 07, 2008 11:03 AM
To: The main list for the MisterHouse home automation program; 'The main
list for the MisterHouse home automation program'
Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...


Mickey, can you change your get_tv_grid_xmltv to the one I posted and let me
know what happens?

At 11:23 AM 12/7/2008, Mickey Argo wrote:

>Yes, I also had favorite shows announcing but no tv grid.  Replacing '6pm'
>with 'all' on line 185 made the web pages build with channel data for me.
>
>The only other change I made to get_tv_grid_xmltv was on line 313; I
>changed 4000 to 40 so that the page would always rebuild.
>
>Mickey Argo
>
>-----Original Message-----
>From: Timothy Spaulding [mailto:[hidden email]]
>Sent: Sunday, December 07, 2008 7:59 AM
>To: The main list for the MisterHouse home automation program
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>My XMLTV runs every day and I don't get channel data in the web page
either.

>This has been the case since I began using XMLTV (the new code) a while
>back.  However, the favorite TV show announcements do have channel/show
>data and that is what I use.
>
>I am not aware of an additional program/step to get the web page
>populated correctly.
>
>-----Original Message-----
>From: Rick Bolen (GM) [mailto:[hidden email]]
>Sent: Sunday, December 07, 2008 12:51 AM
>To: The main list for the MisterHouse home automation program
>Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
>
>I've gotten get_tv_grid_xmltv to add the subchannel number to the
>$channel_number var before the commits to the DBM. So now there's a
>unique channel number\ID that is pumped into DBM_index to match program
>data entries. The web pages populate with all the channels (3, 3.2,
>3.3, etc), but still no program data is posted.
>
>Do I need to run another program to populate the program data, or does
>get_tv_grid_xmltv build the whole web page for tv data?
>
>Thanks,
>
>Rick
>
>----- Original Message -----
>From: "Rick Bolen (GM)" <[hidden email]>
> > There's other factors at work here. My SD data is for over-the-air
> > digital broadcasters. Standard tv channels are now further divided
> > into
>sub-channels
> > (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is
> > not discerning this, and only recognizes\lists one (sub)channel...
> > and I
>haven't
> > figured out how it matches programme info to a specific channel yet,
> > but
>it
> > won't likely match pgm info to subchannels before it discerns
subchannels.

>
>
>-----------------------------------------------------------------------
>-----
>--
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to
>help pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix
>.com/ ________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
>
>
>-----------------------------------------------------------------------
>-----
>--
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to
>help pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix
>.com/ ________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365
>
>
>
>-----------------------------------------------------------------------
>------- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las
>Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to
>help pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix
>.com/ ________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to:
http://sourceforge.net/mail/?group_id=1365



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: How to config for ScheduleDirect XMLTV Listings...

ricks03
In reply to this post by ricks03

Well, at least for Timothy, the updated copy I sent him appears to
have fixed things for him. Anyone else who'd like to give it a try
before I officially have it added please let me know and I'll forward
it as an attachment.

Rick


At 12:02 PM 12/7/2008, Rick Steeves wrote:

>Mickey, can you change your get_tv_grid_xmltv to the one I posted and
>let me know what happens?
>
>At 11:23 AM 12/7/2008, Mickey Argo wrote:
> >Yes, I also had favorite shows announcing but no tv grid.  Replacing '6pm'
> >with 'all' on line 185 made the web pages build with channel data for me.
> >
> >The only other change I made to get_tv_grid_xmltv was on line 313; I changed
> >4000 to 40 so that the page would always rebuild.
> >
> >Mickey Argo
> >
> >-----Original Message-----
> >From: Timothy Spaulding [mailto:[hidden email]]
> >Sent: Sunday, December 07, 2008 7:59 AM
> >To: The main list for the MisterHouse home automation program
> >Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
> >
> >My XMLTV runs every day and I don't get channel data in the web page either.
> >This has been the case since I began using XMLTV (the new code) a while
> >back.  However, the favorite TV show announcements do have channel/show data
> >and that is what I use.
> >
> >I am not aware of an additional program/step to get the web page populated
> >correctly.
> >
> >-----Original Message-----
> >From: Rick Bolen (GM) [mailto:[hidden email]]
> >Sent: Sunday, December 07, 2008 12:51 AM
> >To: The main list for the MisterHouse home automation program
> >Subject: Re: [mh] How to config for ScheduleDirect XMLTV Listings...
> >
> >I've gotten get_tv_grid_xmltv to add the subchannel number to the
> >$channel_number var before the commits to the DBM. So now there's a unique
> >channel number\ID that is pumped into DBM_index to match program data
> >entries. The web pages populate with all the channels (3, 3.2, 3.3, etc),
> >but still no program data is posted.
> >
> >Do I need to run another program to populate the program data, or does
> >get_tv_grid_xmltv build the whole web page for tv data?
> >
> >Thanks,
> >
> >Rick
> >
> >----- Original Message -----
> >From: "Rick Bolen (GM)" <[hidden email]>
> > > There's other factors at work here. My SD data is for over-the-air
> > > digital broadcasters. Standard tv channels are now further divided
> > > into
> >sub-channels
> > > (up to 5 for a single channel). At the moment, get_tv_grid_xmltv is
> > > not discerning this, and only recognizes\lists one (sub)channel... and
> > > I
> >haven't
> > > figured out how it matches programme info to a specific channel yet,
> > > but
> >it
> > > won't likely match pgm info to subchannels before it discerns
> subchannels.
> >
> >
> >----------------------------------------------------------------------------
> >--
> >SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> >The future of the web can't happen without you.  Join us at MIX09 to help
> >pave the way to the Next Web now. Learn more and register at
> >http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> >________________________________________________________
> >To unsubscribe from this list, go to:
> >http://sourceforge.net/mail/?group_id=1365
> >
> >
> >----------------------------------------------------------------------------
> >--
> >SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> >The future of the web can't happen without you.  Join us at MIX09 to help
> >pave the way to the Next Web now. Learn more and register at
> >http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> >________________________________________________________
> >To unsubscribe from this list, go to:
> >http://sourceforge.net/mail/?group_id=1365
> >
> >
> >
> >-------------------------------------------------------------------
> -----------
> >SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> >The future of the web can't happen without you.  Join us at MIX09 to help
> >pave the way to the Next Web now. Learn more and register at
> >http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> >________________________________________________________
> >To unsubscribe from this list, go to:
> >http://sourceforge.net/mail/?group_id=1365
>
>
>
>
>------------------------------------------------------------------------------
>SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
>The future of the web can't happen without you.  Join us at MIX09 to help
>pave the way to the Next Web now. Learn more and register at
>http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>________________________________________________________
>To unsubscribe from this list, go to:
>http://sourceforge.net/mail/?group_id=1365




------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

12