PDA

View Full Version : New addin for EtiVo - PHP Web frontend



KeyLargoDave
12-01-2004, 07:55 PM
Ok. here's the story. There's only one Windows computer in my house and that's my wife's. I installed EtiVo on it and really like it. The only drawback is that EtiVoWeb on her machine is really slow. I decided to start hacking together a php version that I can run on my linux webserver to replace it.

WARNING - This is kind of an ugly hack that uses sockets to telnet from the webserver to the EtiVo server and run the commands that I need. The webserver needs to have access to the EtiVo telnet interface. Also it needs a PEAR module that's considered beta called XML_Serializer to convert the XML that is passed by EtiVo to arrays needed by php. Also, at the top of listready.php, there's a place that's clearly marked to put the IP or hostname of your EtiVo server.

I'm running this on Fedora Core 3, with Apache 2.0.52 and PHP 4.3.9

So far it spits out a simple table with some of the show information and a hyperlink to the EtiVo server's URL for the wmv file but the framework is there to do anything that the telnet service can do. Feel free to play with it and extend it to your heart's content. I only ask that if you modify it, you submit your changes back to the community.

Masnark
12-01-2004, 09:40 PM
Ok. here's the story. There's only one Windows computer in my house and that's my wife's. I installed EtiVo on it and really like it. The only drawback is that EtiVoWeb on her machine is really slow. I decided to start hacking together a php version that I can run on my linux webserver to replace it.

WARNING - This is kind of an ugly hack that uses sockets to telnet from the webserver to the EtiVo server and run the commands that I need. The webserver needs to have access to the EtiVo telnet interface. Also it needs a PEAR module that's considered beta called XML_Serializer to convert the XML that is passed by EtiVo to arrays needed by php. Also, at the top of listready.php, there's a place that's clearly marked to put the IP or hostname of your EtiVo server.

I'm running this on Fedora Core 3, with Apache 2.0.52 and PHP 4.3.9

So far it spits out a simple table with some of the show information and a hyperlink to the EtiVo server's URL for the wmv file but the framework is there to do anything that the telnet service can do. Feel free to play with it and extend it to your heart's content. I only ask that if you modify it, you submit your changes back to the community.

Neat!

Few things:

1. EtiVoWeb uses sockets the same way, so if you have any questions about how to implement something that EtiVoWeb implements, just ask me.
2. Would it be okay if I add this to the "Addins" section of the site? I know I have been asked for non-IIS and non-PC solutions a couple of times already.
3. I dont know if you use it or don't, but for the easiest possible parsing of the results from EtiVo, send the following command at the beginning of the session:
prompt
This will remove the ">" prompt and will allow you to parse simple XML. Also note that the end of each XML doc is marked as a null (though you must know that if it's working for you)

KeyLargoDave
12-01-2004, 10:22 PM
Go ahead and list it. I've got the parsing down by opening the socket to port 6969 on the windows box using the telnet kludge that I found. After that it was pretty easy to do.

I've never worked with XML before in PHP so it was a learning experience, hence why I used the beta PEAR module. But that module makes things very nice.

Masnark
12-01-2004, 11:18 PM
Go ahead and list it. I've got the parsing down by opening the socket to port 6969 on the windows box using the telnet kludge that I found. After that it was pretty easy to do.

I've never worked with XML before in PHP so it was a learning experience, hence why I used the beta PEAR module. But that module makes things very nice.

http://www.prish.com/etivo/php.htm

If you have anything else you want me to write, send me a PM/Email.

cowboy
12-31-2004, 12:55 AM
I tried this out but get the error below. I edited the listready.php file to include my ipaddress and port that matched the etivo config file. I also shutdown the eTivoServer service (as I do have the whole iis thing setup, but would prefer to use apache with php pages). Regular eTivo works with this port so why wouldn't this little set of pages?

C:\Program Files\Apache Group\Apache2\htdocs\etivophp>php listready.php
PHP Warning: fsockopen(): unable to connect to 192.168.1.102:6969 in C:\Program
Files\Apache Group\Apache2\htdocs\etivophp\telnet.php on line 9
PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Fi
les\Apache Group\Apache2\htdocs\etivophp\telnet.php on line 9
Content-type: text/html
X-Powered-By: PHP/4.3.3

malfunct
12-31-2004, 01:15 AM
I tried this out but get the error below. I edited the listready.php file to include my ipaddress and port that matched the etivo config file. I also shutdown the eTivoServer service (as I do have the whole iis thing setup, but would prefer to use apache with php pages). Regular eTivo works with this port so why wouldn't this little set of pages?

C:\Program Files\Apache Group\Apache2\htdocs\etivophp>php listready.php
PHP Warning: fsockopen(): unable to connect to 192.168.1.102:6969 in C:\Program
Files\Apache Group\Apache2\htdocs\etivophp\telnet.php on line 9
PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Fi
les\Apache Group\Apache2\htdocs\etivophp\telnet.php on line 9
Content-type: text/html
X-Powered-By: PHP/4.3.3

You need the etivoserver to be running. This set of php pages points at the etivo service not to the tivo.

cowboy
12-31-2004, 01:41 AM
You need the etivoserver to be running. This set of php pages points at the etivo service not to the tivo.

Ahhh... yes. You did state that in your original post. Doh! Works just fine now if I change to localhost! Play links work well too.

Thanks

KeyLargoDave
12-31-2004, 01:45 PM
Ahhh... yes. You did state that in your original post. Doh! Works just fine now if I change to localhost! Play links work well too.

Thanks

Glad you like it. As soon as things at work quiet down a little bit, I hope to get some time to extend things. My eventual goal is to get this to mirror EtivoWeb.

Hack5190
02-22-2005, 04:33 PM
I've installed your scripts , Unserializer.php and PEAR. However I am getting the following error when trying to run listready.php :( :


Warning: main(XML/Parser.php): failed to open stream: No such file or directory in c:\temp\php\XML\Unserializer.php on line 29

Fatal error: main(): Failed opening required 'XML/Parser.php' (include_path='.;c:\php\includes;c:\php\pear') in c:\temp\php\XML\Unserializer.php on line 29

My enviroment is Win XP Pro using Abyss Web Server X1 (www.aprelium.com), PHP V 4.3.10 (www.php.net) and PEAR V 1.3.5 (pear.php.net).

Searching PEAR's web site for "Parser" turned up the following:


HTML_BBCodeParser This is a parser to replace UBB style tags with their html equivalents.
Log_Parser A parser for nearly any kind of logfile.
PHP_Parser A PHP Grammar Parser
SQL_Parser An SQL parser
XML_Parser XML parsing class based on PHP's bundled expat

Any suggestions which one I need (use)?

KeyLargoDave
02-22-2005, 06:58 PM
I'm not too familiar with PHP running under windows. Do you have the PEAR PHP extensions loaded into your setup?

Hack5190
02-22-2005, 07:07 PM
I'm not too familiar with PHP running under windows. Do you have the PEAR PHP extensions loaded into your setup?

I found the files and got it working, thanks!

KeyLargoDave
02-22-2005, 07:49 PM
I found the files and got it working, thanks!

Good to hear.

Masnark
02-22-2005, 08:04 PM
Dave,

The new version of EtiVo can potentially break you - send me an email if you want the beta, if you intend to keep this updated and working.

KeyLargoDave
02-22-2005, 08:10 PM
No need. Extracting from the tivo under Windows was getting too easy. I needed a new challenge so I bought a Mac. :)

Hack5190
02-23-2005, 05:24 PM
Dave,

The new version of EtiVo can potentially break you - send me an email if you want the beta, if you intend to keep this updated and working.

Guess I need to sign up as a beta tester for your new dual TiVo version considering that I just wrote additional PHP modules to emulate "queue status", "etivo server status" and "add to queue".

KeyLargoDave
02-23-2005, 06:34 PM
Guess I need to sign up as a beta tester for your new dual TiVo version considering that I just wrote additional PHP modules to emulate "queue status", "etivo server status" and "add to queue".

Sweet, it's good to know that somebody has picked up on this. Thanks.

Masnark
02-23-2005, 09:47 PM
Guess I need to sign up as a beta tester for your new dual TiVo version considering that I just wrote additional PHP modules to emulate "queue status", "etivo server status" and "add to queue".

Sure. Send me an email (http://prish.com/etivo for my email) and I will send you links to the beta. It's going to come out tomorrow probably, so might just want to wait for it - your call.

malfunct
02-24-2005, 12:42 PM
Sure. Send me an email (http://prish.com/etivo for my email) and I will send you links to the beta. It's going to come out tomorrow probably, so might just want to wait for it - your call.

It could be useful for him to get on the mailing list though, he should pm me his e-mail address so I can add him. When I get a chance to get back into modifying EtiVoFace I'll probably be hitting issues he needs to deal with.