Page 1 of 1
How to get XMLTV to run in the background automatically
Posted: Thu Feb 03, 2005 11:53 pm
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.
Posted: Fri Feb 04, 2005 10:39 pm
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
Posted: Mon Feb 07, 2005 9:44 pm
by Ben
Will try.
Many thanks for your help
/silent still pops up an xWindow
Posted: Sat Mar 26, 2005 11:36 am
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)
Posted: Sat Mar 26, 2005 12:24 pm
by alanbirtles
on linux if you add -ns to the end of the command line then it will not display that copyright window
Posted: Sat Mar 26, 2005 8:00 pm
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
Posted: Sun Mar 27, 2005 12:11 pm
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?
Fails on Terminal Window
Posted: Sun Mar 27, 2005 12:51 pm
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!)
Posted: Sun Mar 27, 2005 12:54 pm
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
Posted: Sun Mar 27, 2005 1:05 pm
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
Posted: Sun Mar 27, 2005 1:41 pm
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.
Posted: Mon Apr 04, 2005 11:10 am
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
Posted: Mon Apr 04, 2005 6:28 pm
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