TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo Home Media Features & TiVoToGo
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 10-26-2007, 08:57 PM   #1
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Now Playing (more PHP code) - Part II

Now that TTG has been enabled for the Series3 platform I thought I'd try to revive a really old thread in case any of the new S3/THD owners were interested.

Every now and then I get PM'ed asking how I make the Now Playing pages linked to in my sig. Here's how:

The PHP code that generates the NPLs for each TiVo can be found in this old thread:

http://archive2.tivocommunity.com/ti...d.php?t=218365

In a nutshell:

Quote:
Originally Posted by clam729
This will allow you to retrieve your Now Playing data from your TiVo(s) and display it as either HTML, XML or RSS.
The PHP program connects to the TiVo web server, then parses out the XML into what you see in my sig. It can also create RSS feeds, so you can actually "subscribe" to your own feeds and get updates when any of your TiVo boxes record a show during the day (why? why not?).

I have my own little web server at home, running Linux (which is the same server I run Galleon and pyTiVo on). Every hour, a scheduled job runs the PHP code and refreshes the Now Playing Files.

Check it out, it's pretty cool.
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by windracer : 10-26-2007 at 09:05 PM.
windracer is offline   Reply With Quote
Old 10-28-2007, 01:48 PM   #2
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
I guess no one else thinks this is cool?
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 10-28-2007, 01:50 PM   #3
greg_burns
Now in HD
 
greg_burns's Avatar
 
Join Date: May 2004
Location: Slower Lower Delaware
Posts: 6,376
Quote:
Originally Posted by windracer
I guess no one else thinks this is cool?
I do, but PHP just ain't my thing.
greg_burns is offline   Reply With Quote
Old 10-28-2007, 07:41 PM   #4
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
I still think it's cool I have a new version with bug fixes, new features, new urls, prelim channel logos, etc.

Give me a day or two to give it a final check and I'll upload a copy to this thread...
clam729 is offline   Reply With Quote
Old 10-28-2007, 07:47 PM   #5
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Excellent!
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 10-29-2007, 06:35 AM   #6
gonzotek
tivo_xml developer
 
gonzotek's Avatar
 
Join Date: Sep 2004
Location: Outside Phildadelphia
Posts: 2,189
Quote:
Originally Posted by clam729
I still think it's cool I have a new version with bug fixes, new features, new urls, prelim channel logos, etc.

Give me a day or two to give it a final check and I'll upload a copy to this thread...
Awesome!
gonzotek is offline   Reply With Quote
Old 10-30-2007, 08:09 AM   #7
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
Status update. I am away from home, so editing has been limited.

The following changes have been made:
-alot of cosmetic fixes/changes
-display of the <highdefinition> tag
-PHP updates (still on 4, haven't switch to 5 yet)
-channel logo downloads from the TiVo, however, I still haven't made the channel logo <-> XML connection

Still in progress
-need to update the URLs for IMDB and Zap2It support
-update the "forum" copy of the code
clam729 is offline   Reply With Quote
Old 10-30-2007, 04:53 PM   #8
JohnBrowning
Registered User
 
JohnBrowning's Avatar
 
Join Date: Jul 2004
Location: Plano, TX
Posts: 290
Quote:
Originally Posted by windracer
I guess no one else thinks this is cool?
Sure they do! They just don't want everyone to see what porn they're watching!!
JohnBrowning is offline   Reply With Quote
Old 10-30-2007, 08:54 PM   #9
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Note to clam729: ability to filter pr0n out of NPL.
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 10-30-2007, 09:02 PM   #10
Airey001
Registered User
 
Join Date: Oct 2005
Posts: 31
LOL alway must hide those videos.

And this is something i was interested in also thanks for posting this and thank those that are updating the code.

I have been busy playing with and hacking my new iPod Touch! And really haven't been playing with my tivos all the much recently. Epically since 9.1 broke alot of stuff.
__________________
Toshiba RS-TX20 - 565 - 263 hours
TiVo Series2 - 540 - 141 hours

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Server with
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
services

I am really missing Tivo OS 8.1 right now. Most stuff worked with it!
Airey001 is offline   Reply With Quote
Old 10-30-2007, 09:57 PM   #11
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
Quote:
Originally Posted by windracer
Note to clam729: ability to filter pr0n out of NPL.
Already in there
I have an array that you can put keywords, titles, etc. in that you want filtered out.
clam729 is offline   Reply With Quote
Old 10-31-2007, 07:24 AM   #12
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Brilliant!
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 03-19-2008, 03:55 PM   #13
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
*bump*

Hey clam729, did you ever release that newer version you were working on late last year?

I just noticed the other day that the old (original) version I am using is missing an icon for an in-progress transfer (i.e., the blue dot) and it made me think of this. I'd like to have those HD and filter enhancements.
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 06-28-2008, 11:52 PM   #14
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
Been a while since I replied to this and even looked at my PHP code. I had an idea tonight, fired up the editor and added some new/more code/features.

The previous version of the PHP script would pull back the basic XML data from your TiVo(s) and display it in a webpage. Each show has more XML data - you can see this when you click the title link from my page. Now my PHP script will pull down the basic XML data - THEN - loop through each show and pull it's XML data down as well - process it and expand/enhance the show's listing on the webpage.

The new listing will include ratings, series and show genres, actors, advisorys, director, producer, etc. - I even have the images linked for advisory's and ratings.

Data pulling is fairly quick. I was able to pull the initial data and 80 shows/movies split between 2 TiVos in less than one minute.
clam729 is offline   Reply With Quote
Old 06-30-2008, 11:07 PM   #15
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Sounds cool ... where can we get the new code?
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 07-08-2008, 09:38 PM   #16
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
*bump for clam729*

I'm back from vacation and would like to try out the new stuff. Ready to share it?
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 07-09-2008, 07:36 PM   #17
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
Quote:
Originally Posted by windracer View Post
*bump for clam729*

I'm back from vacation and would like to try out the new stuff. Ready to share it?
Not quite yet - still some kinks to work out. Still trying to get the new parser 100% working. I am able to pull all data I need, now I'm at the part of "prettying it up" for the web output.
clam729 is offline   Reply With Quote
Old 07-09-2008, 09:43 PM   #18
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Some mods I made (with azitnay's help) to index.php include the addition of a header to the main file, stripping out the Tribune notification from each description, and adding a breakdown of sizes (Suggestions, freespace, etc.) to the end. Check the links in my sig for examples and let me know if you want any of that code (I can't remember if you've added that since or not).
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 07-09-2008, 10:29 PM   #19
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 8,757
How are you doing the Season Passes?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Old 07-09-2008, 10:33 PM   #20
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Excel.

Sorry, no magic there.
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 07-10-2008, 03:42 PM   #21
clam729
Registered User
 
Join Date: Nov 2004
Posts: 204
Very nice. I have some of those added already - this is how I am doing it (from index.php)
PHP Code:
$tivoarray[$i]['content'] = str_replace("amp;"""$tivoarray[$i]['content']);
$tivoarray[$i]['title'] = str_replace("amp;"""$tivoarray[$i]['title']);
$tivoarray[$i]['episodetitle'] = str_replace("amp;"""$tivoarray[$i]['episodetitle']);
$tivoarray[$i]['description'] = str_replace("Copyright Tribune Media Services, Inc."""$tivoarray[$i]['description']); 
I'll try and work on it a little tonight.
clam729 is offline   Reply With Quote
Old 12-24-2011, 07:33 PM   #22
HomeUser
Registered User
 
HomeUser's Avatar
 
Join Date: Jan 2003
Location: A2 Michigan
Posts: 2,292
I added some updates to the version in the link that windracer pointed to.

Some of the changes I made

- The collapse cookies now work if you have more than one DVR.

- I added a Summery page useful if you have more than one TiVo DVR.

- Free space is also displayed as a percent with color warnings when the FS gets below a set level.

- Modified the code to continue on to the next DVR instead of trapping out if one of the DVR's is off-line.

- Changed to use GB's instead of MB.

I only tested the code with Linux and did nothing with the RSS.



Code refresh attached
Attached Images
File Type: png tnplimgs.png (156.2 KB, 212 views)
Attached Files
File Type: zip tivo_now_playing.zip (56.3 KB, 7 views)

Last edited by HomeUser : 01-02-2012 at 06:33 PM. Reason: Cosmetic update to index.php and tivo.css
HomeUser is offline   Reply With Quote
Old 01-01-2012, 10:51 PM   #23
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Very cool ... thanks for the updates! I had written a custom shell script wrapper to try and check for "offline" TiVos but it never worked reliably and inevitably wget would get hung up somewhere. Your new solution is a lot nicer, and works!

Just a few things I wanted to point out:

- you misspelled "Available" in index.php (line 14, for the summary page)
- you should add your new .pgid, .srid, .epnum class elements to line 9 of tivo.css so the text is formatted in a similar manner to the other elements there

Thanks again!
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 01-02-2012, 02:48 PM   #24
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Note to others who may upgrade to HomeUser's new version: if you use the check_tivo plugin for Nagios to monitor free space, you'll need to update the plugin code to look for GB instead of MB in the regular expression and also account for the decimal place in the free space number. To do this, I changed the following line:

Code:
if (!preg_match("/Available Space \(including Suggestions\)\: (\d+) MB/",$response, $matches)) {
to:

Code:
if (!preg_match("/Available Space \(including Suggestions\)\: (\d+.\d+) GB\s.*/",$response, $matches)) {

__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 01-02-2012, 06:29 PM   #25
HomeUser
Registered User
 
HomeUser's Avatar
 
Join Date: Jan 2003
Location: A2 Michigan
Posts: 2,292
I used Percent Free instead of the free space for the Nagios check_tivo_freespace script.

Code:
if (!preg_match("/Available Space \(including Suggestions\)\: \d+.\d+\sGB\s\((\d+.\d+).\)*/",
                $response, $matches)) {
Changed the output messages to reflect Percent also
Code:
if (!preg_match("/Available Space \(including Suggestions\)\: \d+.\d+\sGB\s\((\d+.\d+).\)*/",
                $response, $matches)) {
  echo "CRITICAL - Unable to find match in $url\n";
  exit(2);
}

$freespace = intval($matches[1]);
if ($freespace < $critical) {
  echo "CRITICAL - $freespace% is less than $critical% Free\n";
  exit(2);
} else if ($freespace < $warning) {
  echo "WARNING - $freespace% is less than $warning% Free\n";
  exit(1);
} else {
  echo "OK - $freespace% is at least $warning% Free\n";
  exit(0);
}

HomeUser is offline   Reply With Quote
Old 01-02-2012, 06:56 PM   #26
HomeUser
Registered User
 
HomeUser's Avatar
 
Join Date: Jan 2003
Location: A2 Michigan
Posts: 2,292
Quote:
Originally Posted by windracer View Post
Very cool ... thanks for the updates! I had written a custom shell script wrapper to try and check for "offline" TiVos but it never worked reliably and inevitably wget would get hung up somewhere. Your new solution is a lot nicer, and works!

Just a few things I wanted to point out:

- you misspelled "Available" in index.php (line 14, for the summary page)
- you should add your new .pgid, .srid, .epnum class elements to line 9 of tivo.css so the text is formatted in a similar manner to the other elements there

Thanks again!
Good catch, When I started I knew nothing and now know very little about CSS.
I tried to get ProgramId and SeriesId on the same line like Size and Duration. I think one or both of the ID parameters could be used to organize the programs into folders. Not sure if they are really any use in the output.


Made you're suggestions and re-uploaded the tivo_now_playing.zip file in the previous message
Just the two updated files are attached in the zip file this message
Attached Files
File Type: zip update.zip (4.4 KB, 2 views)
HomeUser is offline   Reply With Quote
Old 01-02-2012, 07:59 PM   #27
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Quote:
Originally Posted by HomeUser View Post
I used Percent Free instead of the free space for the Nagios check_tivo_freespace script.
Ah, I like that idea! I made your changes to the plugin, but the regex doesn't seem to work if the percentage is a whole number (ex. 38% instead of 37.8%).
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 01-02-2012, 08:54 PM   #28
HomeUser
Registered User
 
HomeUser's Avatar
 
Join Date: Jan 2003
Location: A2 Michigan
Posts: 2,292
Quote:
Originally Posted by windracer View Post
Ah, I like that idea! I made your changes to the plugin, but the regex doesn't seem to work if the percentage is a whole number (ex. 38% instead of 37.8%).
I just discovered that problem also. Change the second "\d+" one or more of to "\d*" zero or more of.
Code:
f (!preg_match("/Available Space \(including Suggestions\)\: \d+.\d*\sGB\s\((\d+.\d*).\)*/",
                $response, $matches)) {

HomeUser is offline   Reply With Quote
Old 01-03-2012, 04:04 PM   #29
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,197
Perfect, thanks!
__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis
S/old: 746~Premiere, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 01-05-2012, 09:06 AM   #30
gonzotek
tivo_xml developer
 
gonzotek's Avatar
 
Join Date: Sep 2004
Location: Outside Phildadelphia
Posts: 2,189
Thumbs up

Cool, glad to see that people are still using and improving this! The first version (which clam729, et al, then improved upon) was written over a long weekend the month TTG was released, while sick and feverish, so I apologize if the code is ugly .
__________________
Follow @pytivo on Twitter for project updates and more!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
A Web app for Roku Remote Control
gonzotek is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 09:13 PM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |