How to get XMLTV to run in the background automatically

Discussion of my XMLTV Radio Times grabber
Post Reply
Ben

How to get XMLTV to run in the background automatically

Post by Ben »

Hi was wondering if you could give me some help. Am a complete newbie and have a copy of Showshifter ver 3.01.2557 and your grabber version 2.9 W

I have managed to get the grabber to collect listings that i want and then to get showshifter to import using a bat file generated by XMLTV. See below.

"C:\Program Files\XMLTV Radio Times\xmltvrt.exe" /Grab
"C:\Program Files\Home Media Networks Limited\ShowShifter\hmnxmltv.exe" /c "C:\Program Files\Home Media Networks Limited\ShowShifter\listsings.xml" /S:"C:\Program Files\XMLTV Radio Times\userchannels.txt"


A couple of questions that perhapps you could help me with?

1) I would like to get XMLTV to run in the background automatically without popping up in front of SS. How do i do this?
2) After XMLTV has grabbed the listings i get another window that pops up and is the import utility into SS. Can this be made to run in the background aswel?

Any help would be appreciated.

Regards

Ben

PS Great utility by the way. It was so easy to setup even for a newbie like me.
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

to make my utility run in the background add "/silent" after /grab, as for the ss utility i dont know an easy way to get rid of the window, you could upgrade to 3.10, its a free upgrade and has a substantially better showguide
Last edited by alanbirtles on Mon Feb 07, 2005 9:46 pm, edited 1 time in total.
Ben

Post by Ben »

Will try.
Many thanks for your help

:lol:
Adrian

/silent still pops up an xWindow

Post by Adrian »

The /silent flag stops the xmltvrt utility from being an interactive window, but it still pops up a Borland copyright window. This prevents it from being run as cron job. This is my only gripe on what is otherwise a fantasticly useful function.

(Offer of help - If you would like any assistance on xmltvrt to make it run as a full background job, I am available to help).

Adrian (adrian dot challinor at osiris dot co dot uk)
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

on linux if you add -ns to the end of the command line then it will not display that copyright window
Adrian

Post by Adrian »

alanbirtles wrote:on linux if you add -ns to the end of the command line then it will not display that copyright window
Hmm, sounds good, but I get:

[adrian@vdr xmltvrt]# ./xmltvrt /Grab /Siler -ns
xmltvrt: cannot connect to X server
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

hmm, does it work if you just call it from a terminal window (it works for me)? how do i get it to run as a cron job so that i can test this for you?
Adrian

Fails on Terminal Window

Post by Adrian »

If I run from a Telnet terminal (even if I spell /Silent correctly!) it fails when initiating. The command line is

./xmltvrt /Grab /Silent -ns

When I run the exact same command inside a X windows command terminal it works, and does not display anything. This is what I think you expect. Somewhere in the initisation code it trys to open and initialize the X component even thouh it is not going to us it.

To set this up as a cron job, I created a shell script (called epgtest):

Code: Select all

#!/bin/bash
cd ~/xmltvrt
rm data.xml 
./xmltvrt /Grab /Silent -ns

In sequence, this declares itself to be a BASH task, changes to the xmltvrt directory (thats where your code is located), removes the file data.xml and then grabs the TV listing. This works when run in an XTerm command window and prints absolutely nothing on the screen, the window, etc. It fails when run from a telnet session because it can't find the X base.

To set it as a cron job, I used crontab. In crontab, I created the following entries:

Code: Select all



SHELL=/bin/bash



00 *  * * * $HOME/epgtest
15 *  * * * $HOME/epgtest
30 *  * * * $HOME/epgtest
45 *  * * * $HOME/epgtest
This will attempt to execute the epgtest script every 15 minutes. You cna tell if it has run successfully because there will be a file ~/xmltvrt/data.xml left behind. Thats why I delete it, it only gets created at the end of the xmltvrt run when data has been grabbed.

I am not a kyrlix programmer, but I am a pure C/C++/Java programmer. If you want any help on the code side under Unix, don't hesitate to ask (otherwise I shall press on with my policy driven archive project whilst watching TV!)
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

ok, the reason is that my project was coded vary lasily for windows and all the silent option does is simply not display the form, it still requires the x windows system, i will have a play and see if i can get it to run without x
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

ive jyst had a quick look at this and kylix can produce applications that work without x running but it would be a firly major task to make this work, you may be better off using the xmltv from sourceforge as it is more designed for this sort of task
Adrian

Post by Adrian »

Thanks - thats a fair comment. I did use this, but it broke when Radio Times changed the format and blocked XMLTV. They have a new version out that I'm trying to get working now. It has a bug and it's somewhere in the bowels of PERL (a language which I hate with a very real vengence for not logical reason at all).

Thanks for all your hard work - it really is appreciated.
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

if you are still interested, i have made some progress extracting the code from the gui and will probably have a first version of a command line only grabber (which will still be configured through the gui) working in the next few days
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

its done, give it a try and let me know if it works. The output on linux isnt as good as it is on windows but if you only want to use it in an unattended task that shouldn't matter
Post Reply