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:
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?
- 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?