More Fun with Batch Files

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
This one revolves around the downloading of xml based tv listings for an EPG. The goal is to completely automate this by placing the batch file in the Startup folder. What I would like the batch file to do is:

- check to see if listings for the current date exists; if they do exist then the batch file should terminate
- if listings do not exist for the date, then the batch file should delete the current listings file and proceed to download new listings and carry out some other tasks

The second part is easy:
del na.xml ; rather obvious what this does
xmltv tv_grab_na --days 2 >na.xml ; launches xmltv to grab 2 days of info and store it in a file named na.xml
fixxmltvlistings na.xml ; launches a vbs script that corrects some irregularities in the xml file

Its the first part (checking/parsing date info and either terminating or proceeding) that I don't know how about tackling. The idea's that I can think of are:
a) some sort of script file that parses date info from the na.xml file
b) renaming the na.xml file into a date format and then using some sort of "if" type statements for determining if listings for a current date exist.

The first way is more elequant. Problem: I don't know how to program vbs ...(or just about anything else for that matter). The second way is klunky and may not be possible to achieve my goal...plus it would probably take me forever to figure out.

Any ideas/hints? Is what I'm proposing possible with a batch file?
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,297
Location
I am omnipresent
Are we working in 98ish command.com or NTish cmd.exe? It shouldn't be that hard to whip something up with cmd.exe
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Sorry, this is for NT cmd (W2K and XP).

The content of na.xml would be huge, so for a smaller example what I did was configured xmltv.exe to grab the listings just for one day and only for channel 2. As you can see, there is still a alot of data.

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">

<tv date="20040306224506 -0500" source-info-url="http://www.zap2it.com" source-info-name="Zap2It" generator-info-name="tv_grab_na V3.20040101" generator-info-url="http://sourceforge.net/projects/xmltv">
  <channel id="2 CICA">
    <display-name>2 CICA</display-name>
    <display-name>2</display-name>
  </channel>
  <programme start="20040306003000 -0500" stop="20040306013000 -0500" channel="2 CICA">
    <title>Heartbeat</title>
    <sub-title>Absent Friends</sub-title>
    <desc>A farm couple go missing; Jenny leaves Merton hanging.</desc>
    <category>Crime</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>14</value>
    </rating>
  </programme>
  <programme start="20040306013000 -0500" stop="20040306023000 -0500" channel="2 CICA">
    <title>Human Edge</title>
    <sub-title>Ukrainian Brides</sub-title>
    <desc>Lonely Israeli men travel to Ukraine to select brides they have seen on the Internet.</desc>
    <episode-num system="xmltv_ns"> .  . 0/2</episode-num>
  </programme>
  <programme start="20040306023000 -0500" stop="20040306033000 -0500" channel="2 CICA">
    <title>More to Life</title>
    <desc>Information viewers can apply to daily life. Hosted by Mary Ito.</desc>
  </programme>
  <programme start="20040306033000 -0500" stop="20040306035500 -0500" channel="2 CICA">
    <title>Whole Notes</title>
    <sub-title>Brahms: Keeper of the Classical Flame</sub-title>
    <desc>Johannes Brahms is an important composer of the 19th century.</desc>
    <category>Musical</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306035500 -0500" stop="20040306050000 -0500" channel="2 CICA">
    <title>SIGN OFF</title>
  </programme>
  <programme start="20040306050000 -0500" stop="20040306053000 -0500" channel="2 CICA">
    <title>Francoeur</title>
    <category>Doc</category>
  </programme>
  <programme start="20040306053000 -0500" stop="20040306060000 -0500" channel="2 CICA">
    <title>SIGN OFF</title>
  </programme>
  <programme start="20040306060000 -0500" stop="20040306063000 -0500" channel="2 CICA">
    <title>Polka Dot Door</title>
    <sub-title>Trees: Dress-Up Day</sub-title>
    <desc>The toys become tree elves; forestry jobs; making forest creatures.</desc>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306063000 -0500" stop="20040306065000 -0500" channel="2 CICA">
    <title>The Hoobs</title>
    <sub-title>Crash, Bang, Wallop</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306065000 -0500" stop="20040306065500 -0500" channel="2 CICA">
    <title>Oobi</title>
    <sub-title>Share Pretzels</sub-title>
    <category>Children's</category>
  </programme>
  <programme start="20040306065500 -0500" stop="20040306070000 -0500" channel="2 CICA">
    <title>All About Art</title>
    <sub-title>Feather Art</sub-title>
    <category>Children's</category>
  </programme>
  <programme start="20040306070000 -0500" stop="20040306072000 -0500" channel="2 CICA">
    <title>Babar</title>
    <sub-title>Land of Games</sub-title>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306072000 -0500" stop="20040306072500 -0500" channel="2 CICA">
    <title>Simon in the Land of Chalk Drawings</title>
    <sub-title>Simon Meets Henry</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306072500 -0500" stop="20040306073000 -0500" channel="2 CICA">
    <title>Energy Blasts</title>
    <sub-title>Hip Hop Groove it Down</sub-title>
    <category>Children's</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306073000 -0500" stop="20040306074000 -0500" channel="2 CICA">
    <title>Corduroy Bear</title>
    <sub-title>Toothache</sub-title>
    <desc>Lisa has a toothache.</desc>
    <category>Children's</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306074000 -0500" stop="20040306075500 -0500" channel="2 CICA">
    <title>Sagwa, the Chinese Siamese Cat</title>
    <sub-title>Master of Mistakes</sub-title>
    <desc>Learning from mistakes.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306075500 -0500" stop="20040306080000 -0500" channel="2 CICA">
    <title>Open Your Ears</title>
    <sub-title>Acoustics</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y7</value>
    </rating>
  </programme>
  <programme start="20040306080000 -0500" stop="20040306082500 -0500" channel="2 CICA">
    <title>Jakers! The Adventures of Piggley Winks</title>
    <desc>The adventures of an eight-year-old pig.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306082500 -0500" stop="20040306083000 -0500" channel="2 CICA">
    <title>Yoko! Jakamoko! Toto!</title>
    <sub-title>The Special Thing</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>G</value>
    </rating>
  </programme>
  <programme start="20040306083000 -0500" stop="20040306085500 -0500" channel="2 CICA">
    <title>Arthur</title>
    <sub-title>Desk Wars; Desperately Seeking Stanley</sub-title>
    <desc>A desk war erupts on the hottest school day of the year; Arthur's teddy bear Stanley.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306085500 -0500" stop="20040306090000 -0500" channel="2 CICA">
    <title>Tumbletown Tales</title>
    <category>Children's</category>
  </programme>
  <programme start="20040306090000 -0500" stop="20040306092500 -0500" channel="2 CICA">
    <title>Zoboomafoo</title>
    <sub-title>Brain Power</sub-title>
    <desc>Intelligence; India; crows; elephants.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306092500 -0500" stop="20040306093000 -0500" channel="2 CICA">
    <title>Why?</title>
    <sub-title>Why Do We Have Seasons?</sub-title>
    <category>Children's</category>
  </programme>
  <programme start="20040306093000 -0500" stop="20040306095500 -0500" channel="2 CICA">
    <title>George Shrinks</title>
    <sub-title>Lost World</sub-title>
    <category>Children's</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306095500 -0500" stop="20040306100000 -0500" channel="2 CICA">
    <title>Open Your Ears</title>
    <sub-title>Harmony</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y7</value>
    </rating>
  </programme>
  <programme start="20040306100000 -0500" stop="20040306102500 -0500" channel="2 CICA">
    <title>The Adventures of Paddington Bear</title>
    <desc>``One Bear's Treasure''; ``A Bear of Style''; ``A Night at the Opera.''</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306102500 -0500" stop="20040306103000 -0500" channel="2 CICA">
    <title>The Wild Side</title>
    <sub-title>Giraffe</sub-title>
    <category>Animals</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306103000 -0500" stop="20040306105500 -0500" channel="2 CICA">
    <title>Swap TV</title>
    <desc>Two youths from different backgrounds swap lives for two days.</desc>
    <category>Comedy</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306105500 -0500" stop="20040306110000 -0500" channel="2 CICA">
    <title>Reading Rangers</title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306110000 -0500" stop="20040306112500 -0500" channel="2 CICA">
    <title>The Country Mouse and the City Mouse Adventures</title>
    <sub-title>Cinematic Mice</sub-title>
    <desc>The Lumieres invent the first motion-picture camera in France.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306112500 -0500" stop="20040306113000 -0500" channel="2 CICA">
    <title>The Bod Squad</title>
    <sub-title>Chocolate Hunter</sub-title>
    <category>Edu</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306113000 -0500" stop="20040306115500 -0500" channel="2 CICA">
    <title>CG Kids</title>
    <sub-title>The Yukon Quest</sub-title>
    <category>Children's</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306115500 -0500" stop="20040306120000 -0500" channel="2 CICA">
    <title>Pingu</title>
    <sub-title>Ice, Skating, Hockey</sub-title>
    <category>Children's</category>
    <rating system="VCHIP">
      <value>Y</value>
    </rating>
  </programme>
  <programme start="20040306120000 -0500" stop="20040306120500 -0500" channel="2 CICA">
    <title>deafplanet.com</title>
    <sub-title>Max Overdrive</sub-title>
    <category>Children's</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306120500 -0500" stop="20040306123000 -0500" channel="2 CICA">
    <title>Popular Mechanics for Kids</title>
    <sub-title>Zoos</sub-title>
    <desc>Zoos; biodomes; endangered species.</desc>
    <category>Children's</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>Y7</value>
    </rating>
  </programme>
  <programme start="20040306123000 -0500" stop="20040306130000 -0500" channel="2 CICA">
    <title>VOX</title>
    <desc>With Patty Sullivan and Shane Azam.</desc>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306130000 -0500" stop="20040306150000 -0500" channel="2 CICA">
    <title>Big Ideas</title>
    <desc>Academics and social activists share thoughts.</desc>
    <category>Edu</category>
  </programme>
  <programme start="20040306150000 -0500" stop="20040306153000 -0500" channel="2 CICA">
    <title>Diplomatic Immunity With Steve Paikin</title>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306153000 -0500" stop="20040306160000 -0500" channel="2 CICA">
    <title>Imprint</title>
    <desc>With Tina Srebotnjak</desc>
    <category>Talk</category>
    <category>Tabloid</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306160000 -0500" stop="20040306170000 -0500" channel="2 CICA">
    <title>More to Life</title>
    <desc>Information viewers can apply to daily life. Hosted by Mary Ito.</desc>
  </programme>
  <programme start="20040306170000 -0500" stop="20040306180000 -0500" channel="2 CICA">
    <title>History's Courtroom</title>
    <sub-title>DNA: Irrefutable Proof</sub-title>
    <desc>Genetic testing.</desc>
    <category>Reality</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306180000 -0500" stop="20040306183000 -0500" channel="2 CICA">
    <title>Great Canadian Parks</title>
    <sub-title>Lac La Ronge Provincial Park: Saskatchewan</sub-title>
    <desc>Lac La Ronge Park's 100 lakes and 1000 islands protects breeding bald eagles.</desc>
    <category>Travel</category>
    <audio>
      <stereo>stereo</stereo>
    </audio>
  </programme>
  <programme start="20040306183000 -0500" stop="20040306190000 -0500" channel="2 CICA">
    <title>Great Canadian Rivers</title>
    <sub-title>North Saskatchewan River</sub-title>
    <desc>The North Saskatchewan River has a history full of diversity.</desc>
    <category>Travel</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306190000 -0500" stop="20040306200000 -0500" channel="2 CICA">
    <title>National Geographic</title>
    <sub-title>Shark Sonics</sub-title>
    <desc>Sharks have begun to congregate near people.</desc>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306200000 -0500" stop="20040306213000 -0500" channel="2 CICA">
    <title>Gun Crazy</title>
    <desc>A gun fanatic and a sideshow sharpshooter team up for romance and a crime spree.</desc>
    <date>1949</date>
    <category>Crime</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>14</value>
    </rating>
    <rating system="MPAA">
      <value>NR</value>
    </rating>
    <star-rating>
      <value>3.5/4</value>
    </star-rating>
  </programme>
  <programme start="20040306213000 -0500" stop="20040306215000 -0500" channel="2 CICA">
    <title>The Interviews</title>
    <desc>The role of the outlaw film.</desc>
    <category>Talk</category>
    <category>Tabloid</category>
    <subtitles type="teletext" />
  </programme>
  <programme start="20040306215000 -0500" stop="20040306234500 -0500" channel="2 CICA">
    <title>Bonnie and Clyde</title>
    <desc>Bonnie Parker and Clyde Barrow become 1930s outlaw lovers.</desc>
    <date>1967</date>
    <category>Crime</category>
    <subtitles type="teletext" />
    <rating system="VCHIP">
      <value>14</value>
    </rating>
    <rating system="MPAA">
      <value>NR</value>
    </rating>
    <star-rating>
      <value>4/4</value>
    </star-rating>
  </programme>
  <programme start="20040306234500 -0500" channel="2 CICA">
    <title>The Interviews</title>
    <desc>The role of the outlaw film.</desc>
    <category>Talk</category>
    <category>Tabloid</category>
    <subtitles type="teletext" />
  </programme>
</tv>

If multiple channels are grabbed, the na.xml file first lists all the channel ids first and then does the programs for each channel. For example:

Code:
channel 2 id stuff
channel 3 id stuff
....
last channel id stuff
program info for 12AM on channel two 
program infor for 1AM on channel two
....
program info for 12AM on channel three
....
and so forth through the last channel

As you can see, there is plenty of yyyymmddhhmmss info that could be parsed.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Doh! What was I thinking, I completely missed Ukranian Brides this morning :D
 

Howell

Storage? I am Storage!
Joined
Feb 24, 2003
Messages
4,740
Location
Chattanooga, TN
Part one done I think. Perhaps you should define what you mean by listing "a listing for a current date". Perhaps an example out of the test file.
-------------------

Code:
@echo off
for /F "tokens=2,3,4* delims=/ " %%i in ('date /t') do set date=%%k%%j%%i


:start
find /I "20040306" na.xml >>nul
If errorlevel 0 goto :exist


:exist
echo Listings for today exist. Terminating.
rem pause
:end
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Howell, first off, thanks for your work tackling this. When I was looking through the help cmd documentation earlier on I was thinking that the "For" cmd definitely held some promise. I kind of get the gist of what your code does, but honestly I will have to go through the help for documentation to follow the logic through. It would probably would have taken me quite a very long while to get to where your code is at.

Howell said:
Perhaps you should define what you mean by listing "a listing for a current date".
Each time I run xmltv.exe I'm currently grabbing two days worth of tv program scheduling. So taking an arbitrary date as an example, say on the morning of April 7th I use xmltv.exe to download two days worth of program scheduling (April 7ths and April 8ths). The generated xml listings file (na.xml) will look something like:
<tv date=" 20040407xxxxxx .... blah blah blah ......>
<channel id = 2 ....
.....
<channel id =72 ..... </channel>
<program start="20040407000000 ....... channel=2>
....
<program start="20040407233000....... channel=2>
<program start="20040407000000 ....... channel=3>
.....and so forth till ...
<program start="20040407233000....... channel=72>
<program start="20040408000000 ....... channel=2>
....
....
<program start="20040408[/color]233000 ....... channel=72>
</program>
</tv>
Then say I turn the computer off. Later that same day I turn the system back on. Already having the xml tv listings for April 7th, when the batch file in the startup folder runs, the logic it employs should figure out that there is no need to lauch xmltv.exe to download new program listings/schedulings. By this I mean that ideally it should search through the xml listings file (na.xml) for references to the current date (i.e. 20040407). The same should apply anytime the computer is turned on during April 8th (i.e. searching through na.xml will find references for 20040408...in otherwords, listings/program schedules already exist for that day). However, when the "current" date becomes April 9th, searching through the na.xml file will discover no references to the current date (20040409). Thus the tv listings have become dated and new ones are required, so the batch file should launch xmltv.exe to grab listings for the next two days (April 9 and 10). And then the whole procedure repeats itself.

Given what I just said, and looking at your code, is there a way to do
@echo off
for /F "tokens=2,3,4* delims=/ " %%i in ('date /t') do set date=%%k%%j%%i


:start
find /I "insert actual current date here somehow" na.xml >>nul
If errorlevel 0 goto :exist


:exist
echo Listings for today exist. Terminating.
rem pause
:end
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
From what I've been reading, you can't stick "date /t" in there because the formatting of the date will be incorrect for the XML file.

I had to change the order of the dating based on howell's example and then placed the date variable into the find string... I couldn't test to see if it worked.

@echo off
for /F "tokens=2,3,4* delims=/ " %%i in ('date /t') do set date=%%k%%i%%j


:start
find /I "%date%" na.xml >>nul
If errorlevel 0 goto :exist


:exist
echo Listings for today exist. Terminating.
rem pause
:end

echo %date%
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
oops. get rid of the last "echo %date%" code that I put in there. I forgot to remove it. That was a test for me.
 

Howell

Storage? I am Storage!
Joined
Feb 24, 2003
Messages
4,740
Location
Chattanooga, TN
CityK, the find command wants a text string within the quotes. Yes, I goofed the formatting (I nhad it yyyddmm) but Handy fixed it.

Is the "tv date="20040306224506..." the day of the download or is it related to the content in some way?

It would be helpful to see a multi-day download. You wouldn't need to provide more than a few channels.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Howell said:
Is the "tv date="20040306224506..." the day of the download or is it related to the content in some way?
Precisely the the former. No bearing on the content.

If it helps, xmltv can be downloaded from Sourceforge and inside the package the text file xmltv.dtd outlines the format of the xml listings file generated by xmltv.exe. However, before the EPG can use the info contained in the xml listings file, it has to be processed by the vbs file fixxmltvlistings.vbs (whose code can be viewed here).

It would be helpful to see a multi-day download. You wouldn't need to provide more than a few channels.
Yi Caromba! That would be a MIGHTY BIG code post. If no one else objects, I could post a a two day grab for two channels. Alternatively, I could email you the file.

Or if you d/l xmltv, you could generate a listings file for yourself for your area. The only thing required out of the package is the xmltv.exe file itself. Place it in any directory. Drop to the cmdline and run
Code:
xmltv tv_grab_na --configure
This causes xmltv to prompt you to input your zip code, your tv provider, and the channels you would like included. This provided information is then stored by xmltv.exe in a configuration file called xmltvtv_grab_na.conf, which is placed within a simutaneously created sub folder called \.xmltv within the directory that xmltv.exe resides. Future use of xmltv.exe will now draw from the configuration information contained in that file. (From memory I believe this whole process takes about a minute on broadband).

Once that's completed, you can run
Code:
xmltv tv_grab_na --days 2 >na.xml
xmltv.exe downloads the xml listings into a file named na.xml within the same directory as xmltv.exe. (Grabbing the listing takes about a minute or two on broadband for 2 days worth of info for ~60 channels).

After that, you'd run the fixxmltvlistings script on na.xml via the cmd line
Code:
FixXMLTVListings na.xml
(This process is of an infinitesimal duration)

And Voila! The finished na.xml is precisely the xml listings file that I want to have the batch file parse for current date info ... and then either proceed to d/l new listings or terminate if new listings aren't required.

BTW, am I using "parse" in the correct context?
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
After that, you'd run the fixxmltvlistings script on na.xml via the cmd line
Code:
FixXMLTVListings na.xml
Of course, this assumes that you saved the fixxmltvlistings.vbs file in the same directory as which you placed xmltv.exe
 

Howell

Storage? I am Storage!
Joined
Feb 24, 2003
Messages
4,740
Location
Chattanooga, TN
Not that I'm not enjoying the problem solving, but wouldn't it be easier to schedule the download to run every two days and pull two days worth. Then you wouldn't need all this error checking.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Try the following as the contents of your tv_grab_na.conf file
Code:
# config file: tv_grab_na 3.20040101
#
# this file is generated by running tv_grab_na --configure
# the only change you should make is prefixing 'channel:' lines
# with a 'not ' to signal that they should be ignored during the
# grab step
#retry limit: 2
retry delay: 30
postal code: M6S3M8
provider: 122174 Rogers Cable Inc. - Toronto (part of)
channel: 2 CICA
channel: 3 CIII
channel: 4 CFMT

that should generate a good example xml listings file when you run
Code:
xmltv tv_grab_na --days 2 >na.xml
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Howell said:
but wouldn't it be easier to schedule the download to run every two days and pull two days worth. Then you wouldn't need all this error checking.
Hmmmmm. When you put it like that, I can't even remember why I opted to not use scheduler.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Thinking about this over dinner tonight, I guess the reasons why I haven't bothered with Task Scheduling in a long time (in fact I have the service disabled) are:

- when I first got W2K, I found that Task Scheduling often did not work when it should have. Apparently that bug has long been resolved....of course, that isn't to say that it doesn't still contain bugs :lol: (i.e. such as this semi-recently excised critter)
- potential for security exploits?
- but the number one reason I have is its footprint....I guess its a small price to pay for the added convience of automated scheduling.

I guess it comes down to a question of whether spending the time to find an alternative solution (which doesn't continuously utilize resources) is worth the time and effort or not. For me, well, I guess I'm learning a few things along the way, so it does have some value....but perhaps I could spend my time more wisely.

Anyways, thanks again for your help.
 

Howell

Storage? I am Storage!
Joined
Feb 24, 2003
Messages
4,740
Location
Chattanooga, TN
CityK said:
- but the number one reason I have is its footprint....I guess its a small price to pay for the added convience of automated scheduling.

Small indeed. In fact on the web I can't find any reference to anyone who is concerned about it.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Howell said:
Small indeed. In fact on the web I can't find any reference to anyone who is concerned about it.
Now your making me feel bad that I completely went off on a tangent :(

Oh well, what can I say. Some times I get obsessive and lose a bit of focus.

Lesson learned. Ram is cheap, time is precisious.....hopefully I'll remember.
 

Howell

Storage? I am Storage!
Joined
Feb 24, 2003
Messages
4,740
Location
Chattanooga, TN
CityK said:
Howell said:
Small indeed. In fact on the web I can't find any reference to anyone who is concerned about it.
Now your making me feel bad that I completely went off on a tangent :(

Naw, don't.:) I enjoyed the the problem solving exercise. Except in this case the best solution was not a technical one. No worries.
 

CityK

Storage Freak Apprentice
Joined
Sep 2, 2002
Messages
1,719
Howell,

the story gets even funnier. Last night I was wondering if their was any simple options that could be used with xmltv so that it would grab ever more detailed program info, so I took a look at the options of the tv_grab_na filter. I think this actually has the very functionality (that I was seeking last weekend) buit into it. I say "think" because the formating of the documentation certainly isn't easy to read or follow (plain text file in notepad).
 
Top