Customizing the Ceton Tuner Summary HTML Page

Ask fellow members about Ceton's infiniTV tuners here.
Forum rules
Ceton no longer participate in this forum. Official support may still be handled via the Ceton Ticket system.
Post Reply
tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

Customizing the Ceton Tuner Summary HTML Page

#1

Post by tzr916 » Thu Jun 19, 2014 5:31 pm

The original:

Code: Select all

<html>
<body>
<div class='header'>     Ceton InfiniTV</div>
<table>
<tr>
<td width=100>Temp</td>
<td width=100>Signal Level</td>
<td width=100>SNR</td>
<td width=100>Playback</td>
<td width=100>Frequency</td>
<td width=100>Modulation</td>
<td width=200>Copy Protection</td>
<td width=100>Channel</td>
</tr>
</table>
<div id="variable_row">
<div id="variable_label">Tuner #1:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
</div>
<div id="variable_label">Tuner #2:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
<div id="variable_label">Tuner #3:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
<div id="variable_label">Tuner #4:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
<div id="variable_label">Tuner #5:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
<div id="variable_label">Tuner #6:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Signal_SNR'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=tuner&v=Frequency'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=tuner&v=Modulation'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:200px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=CopyProtectionStatus'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
</body>
</html>
I am trying to make it look a little "better" so I can possibly display it on a 2nd monitor (and auto refresh). I am not any good with HTML. I really want black background and the frames to be all be dark blue and the text to be white. I have pared it down to status, channel, temp, signal, snr. This is as far as I have gotten:

Code: Select all

<html>
<body>
<body bgcolor="#000000">
<div class='header'>     Ceton InfiniTV</div>
<table>
<tr bgcolor="#4169E1">
<td width=100>Playback</td>
<td width=100>Channel</td>
<td width=100>Temp</td>
<td width=100>Signal Level</td>
<td width=100>SNR</td>
</tr>
</table>
<div id="variable_row">
<div id="variable_label">Tuner #1:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=0&s=diag&v=Signal_SNR'>
</iframe>
</div>
<div id="variable_label">Tuner #2:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=1&s=diag&v=Signal_SNR'>
</iframe>
</div>
<div id="variable_label">Tuner #3:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=2&s=diag&v=Signal_SNR'>
</iframe>
</div>
<div id="variable_label">Tuner #4:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=3&s=diag&v=Signal_SNR'>
</iframe>
</div>
<div id="variable_label">Tuner #5:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=4&s=diag&v=Signal_SNR'>
</iframe>
</div>
<div id="variable_label">Tuner #6:</div>
<div id="variable_value">
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=av&v=TransportState'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Temperature'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Signal_Level'>
</iframe>
<iframe frameborder='0' scrolling='no' style='padding: 0px; margin: 0px; width:100px; height:50px;' src='http://192.168.1.47/get_var?i=5&s=diag&v=Signal_SNR'>
</iframe>
</div>
</body>
</html>
I read that iframe color cannot be changed???

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#2

Post by tzr916 » Mon Jun 23, 2014 11:41 pm

Seems it's impossible to change the background/font/etc of what's inside the iframe. Latest version:

Code: Select all

<html>
<body>
<body bgcolor="#000000">
<div align="center">
<div id="variable_value">
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=0&s=av&v=TransportState'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=1&s=av&v=TransportState'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=2&s=av&v=TransportState'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=3&s=av&v=TransportState'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=4&s=av&v=TransportState'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=5&s=av&v=TransportState'>
</iframe>
</div>
<div align="center">
<div id="variable_value">
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=0&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=1&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=2&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=3&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=4&s=cas&v=VirtualChannelNumber'>
</iframe>
<iframe frameborder='1' scrolling='no' style='padding: 3px; margin: 1px; width:35px; height:20px;' src='http://192.168.1.47/get_var?i=5&s=cas&v=VirtualChannelNumber'>
</iframe>
</div>
</body>
</html>
If I were a programmer, I would create something to strip out the text that each variable returned.
If TransportState = "stopped" then just display a big gray X.
If TransportState = "playing" then display the VirtualChannelNumber value in large red font.

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#3

Post by tzr916 » Mon Jun 30, 2014 10:50 pm

Here is my latest. This is much better considering I knew nothing about html/php before this. Might try some more tweaking like changing the color based on Playing or Stopped. I got a 7" LCD and set it on the top shelf of my components shelves:
Image

This takes a bunch of setup, running local server software so that php code works. Basicallly:
1. Install all the needed Microsoft Visual C++ packages - forum.wampserver.com/read.php?2,123608
2. Make sure if you use Skype to change it from port 80 to port 443 (sorry not available for Win8 app) and disable windows feature IIS.
3. Install WAMP - http://www.wampserver.com/en/
4. Test WAMP is working (icon green in tray and can get to localhost wamp home page)
5. Create new project by making new folder c:/wamp/www/ceton/.
6. Download/extract php simple html dom parser into the new project directory - sourceforge.net/projects/simplehtmldom/files/
7. Create new file named ceton.php in the new project directory.
8. Edit ceton.php with notepad. Copy/paste/save this code into it:

Code: Select all

<html>
<body>
<body bgcolor="#000000">
<font color="#66FF33">
<font size="3">
<div align="center">
<div id="variable_value">
<?php
header("refresh: 3;");
include_once('simple_html_dom.php');
echo file_get_html('http://192.168.1.47/get_var?i=0&s=av&v=TransportState')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=1&s=av&v=TransportState')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=2&s=av&v=TransportState')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=3&s=av&v=TransportState')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=4&s=av&v=TransportState')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=5&s=av&v=TransportState')->plaintext;
?>
</div>
<div align="center">
<div id="variable_value">
<font size="6">
<?php
header("refresh: 3;");
include_once('simple_html_dom.php');
echo file_get_html('http://192.168.1.47/get_var?i=0&s=cas&v=VirtualChannelNumber')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=1&s=cas&v=VirtualChannelNumber')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=2&s=cas&v=VirtualChannelNumber')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=3&s=cas&v=VirtualChannelNumber')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=4&s=cas&v=VirtualChannelNumber')->plaintext;
echo " | ";
echo file_get_html('http://192.168.1.47/get_var?i=5&s=cas&v=VirtualChannelNumber')->plaintext;
?>
</div>
</font>
</body>
</html>
9. Open your web browser and type localhost/ceton/ceton.php press Go!

Don't try to double click and don't try to put this in your browser- c:/wamp/www/ceton/ceton.php it won't work.

Feel free to play with the code to change font, colors, refresh times....

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#4

Post by tzr916 » Fri Jul 04, 2014 2:46 pm

Final Product! This code sets the color of the TransportState and VirtualChannelNumber to green when the tuner is playing then red when the tuner is stopped. Status refreshed every 30 seconds. Turned it into a gadget/widget by using an Adobe AIR program called Snippage. Now I can see how many tuners are in use from across the room.
http://snippage.gabocorp.com/

Image

Code: Select all

<html>
<body>
<body bgcolor="#000000">
<?php 
header("refresh: 30;");
include_once('simple_html_dom.php');
$file_A = file_get_html('http://192.168.1.47/get_var?i=0&s=av&v=TransportState')->plaintext;
if ($file_A == 'PLAYING') {
    $fontcolorA = '#66FF33';
} else {
    $fontcolorA = '#FF4719';
} ?>
<?php
$file_B = file_get_html('http://192.168.1.47/get_var?i=1&s=av&v=TransportState')->plaintext;
if ($file_B == 'PLAYING') {
    $fontcolorB = '#66FF33';
} else {
    $fontcolorB = '#FF4719';
} ?>
<?php
$file_C = file_get_html('http://192.168.1.47/get_var?i=2&s=av&v=TransportState')->plaintext;
if ($file_C == 'PLAYING') {
    $fontcolorC = '#66FF33';
} else {
    $fontcolorC = '#FF4719';
} ?>
<?php
$file_D = file_get_html('http://192.168.1.47/get_var?i=3&s=av&v=TransportState')->plaintext;
if ($file_D == 'PLAYING') {
    $fontcolorD = '#66FF33';
} else {
    $fontcolorD = '#FF4719';
} ?>
<?php
$file_E = file_get_html('http://192.168.1.47/get_var?i=4&s=av&v=TransportState')->plaintext;
if ($file_E == 'PLAYING') {
    $fontcolorE = '#66FF33';
} else {
    $fontcolorE = '#FF4719';
} ?>
<?php
$file_F = file_get_html('http://192.168.1.47/get_var?i=5&s=av&v=TransportState')->plaintext;
if ($file_F == 'PLAYING') {
    $fontcolorF = '#66FF33';
} else {
    $fontcolorF = '#FF4719';
} ?>
<div align="center">
<b>
<font size="3">
<font color="<?php echo $fontcolorA; ?>">
<?php
echo $file_A;
?>
<font color="#DBDBDB">
<?php
echo "|"
?>
<font color="<?php echo $fontcolorB; ?>">
<?php
echo $file_B;
?>
<font color="#DBDBDB">
<?php
echo "|"
?>
<font color="<?php echo $fontcolorC; ?>">
<?php
echo $file_C;
?>
<font color="#DBDBDB">
<?php
echo "|"
?>
<font color="<?php echo $fontcolorD; ?>">
<?php
echo $file_D;
?>
<font color="#DBDBDB">
<?php
echo "|"
?>
<font color="<?php echo $fontcolorE; ?>">
<?php
echo $file_E;
?>
<font color="#DBDBDB">
<?php
echo "|"
?>
<font color="<?php echo $fontcolorF; ?>">
<?php
echo $file_F;
?>
</div>
</b>
<div align="center">
<font size="6">
<font color="<?php echo $fontcolorA; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=0&s=cas&v=VirtualChannelNumber')->plaintext;
?>
<font size="5">
<font color="#DBDBDB">
<?php
echo "~";
?>
<font size="6">
<font color="<?php echo $fontcolorB; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=1&s=cas&v=VirtualChannelNumber')->plaintext;
?>
<font size="5">
<font color="#DBDBDB">
<?php
echo "~";
?>
<font size="6">
<font color="<?php echo $fontcolorC; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=2&s=cas&v=VirtualChannelNumber')->plaintext;
?>
<font size="5">
<font color="#DBDBDB">
<?php
echo "~";
?>
<font size="6">
<font color="<?php echo $fontcolorD; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=3&s=cas&v=VirtualChannelNumber')->plaintext;
?>
<font size="5">
<font color="#DBDBDB">
<?php
echo "~";
?>
<font size="6">
<font color="<?php echo $fontcolorE; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=4&s=cas&v=VirtualChannelNumber')->plaintext;
?>
<font size="5">
<font color="#DBDBDB">
<?php
echo "~";
?>
<font size="6">
<font color="<?php echo $fontcolorF; ?>">
<?php
echo file_get_html('http://192.168.1.47/get_var?i=5&s=cas&v=VirtualChannelNumber')->plaintext;
?>
</font>
</div>
</body>
</html>


User avatar
STC

Posts: 6808
Joined: Mon Jun 06, 2011 4:58 pm
Location:

HTPC Specs: Show details

#5

Post by STC » Sat Jul 05, 2014 2:38 pm

This is neat.

Thank you for your hard work.
By the Community, for the Community. 100% Commercial Free.

Want decent guide data back? Check out EPG123

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#6

Post by richard1980 » Sun Jul 06, 2014 8:14 pm

Just for the heck of it, I cleaned up that code. I don't have an infiniTV anymore so I can't test it, but it should work assuming the plain text output of file_get_html is actually plain text.

Code: Select all

<?php
header('refresh: 30;');

require('simple_html_dom.php');

const TUNER_COUNT = 6;
const TUNER_IP    = '192.168.1.47';

for ($tuner = 0; $tuner < TUNER_COUNT; $tuner++) {
    $tunerStatus  = file_get_html(
        'http://' . TUNER_IP . "/get_var?i=$tuner&s=av&v=TransportState"
    )->plaintext;
    $tunerChannel = file_get_html(
        'http://' . TUNER_IP . "/get_var?i=$tuner&s=cas&v=VirtualChannelNumber"
    )->plaintext;
    if (strtoupper($tunerStatus) === 'PLAYING') {
        $status[]  = "<span class=\"playing\">$tunerStatus</span>";
        $channel[] = "<span class=\"channel playing\">$tunerChannel</span>";
    } else {
        $status[]  = "<span class=\"notplaying\">$tunerStatus</span>";
        $channel[] = "<span class=\"channel notplaying\">$tunerChannel</span>";
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Ceton infiniTV Tuner Status</title>
        <style type="text/css">
            body {
                background-color: #000;
                color: #DBDBDB;
                text-align: center;
            }
                       
            .status {
                font-weight: bold;
            }
            
            .channel {
                font-size: large;
            }
            
            .playing {
                color: #66FF33;
            }
            
            .notplaying {
                color: #FF4719;
            }
            
            span.channel {
                font-size: x-large;
            }
        </style>
    </head>
    <body>
        <div class="status">
            <?php echo implode(' | ', $status);?>
        </div>
        <div class="channel">
            <?php echo implode(' ~ ', $channel);?>
        </div>
    </body>
</html>

Post Reply