Results 1 to 9 of 9
  1.    #1  
    With the dog days of summer around the corner, I need to find a way to display my companies Environmental Monitor data (Server-room Temperature data) on my today screen.

    Can mortscript read data from a webpage,FTP Text file, etc. and parse only the temperature or other data I need and display it on the today (Carrier Line)?

    Below is a snippet of the html created by our monitoring system (NOT XML, its unfortunately just HTML reading from a text log file).

    This line is what I would like to read: <td>1466.9 kb/s (95.0%)</td>

    <!-- Begin `Daily' Graph (5 Minute -->
    <div class="graph">
    <h2>`Daily' Graph (5 Minute Average)</h2>
    <img src="t1_serial-day.png" title="day" alt="day" />
    <table>
    <tr>
    <th></th>
    <th scope="col">Max</th>
    <th scope="col">Average</th>
    <th scope="col">Current</th>
    </tr>
    <tr class="in">
    <th scope="row">In</th>
    <td>1466.9 kb/s (95.0%)</td>
    <td>94.6 kb/s (6.1%) </td>
    <td>58.0 kb/s (3.8%) </td>
    </tr>
    <tr class="out">
    <th scope="row">Out</th>
    <td>1514.4 kb/s (98.1%) </td>
    <td>268.6 kb/s (17.4%) </td>
    <td>235.0 kb/s (15.2%) </td>
    </tr>
    </table>
    </div>
    <!-- End `Daily' Graph (5 Minute -->

    What do you think?
  2. #2  
    Yes, take a look at the Xcast thread for an example. You can either preset the data on the carrier line or use zbop's fine today screen plugin (See the carrier wars thread).

    Xcast
    http://discussion.treocentral.com/sh...ighlight=xcast

    zbop's billboard today plugin
    http://discussion.treocentral.com/sh...3&postcount=18
    Last edited by hannip; 05/31/2007 at 10:57 AM.
  3.    #3  
    I did look at xcast, but seems to be a ton of code and parm.'s I dont need. I was just hoping someone had simpler code I could hack together a today plugin to display some parsed html values.

    Anyone else... please?
  4. #4  
    Assuming this format is going to be constant,
    What you need to do is read the URL and store it in a variable:

    Contents = ReadFile(Your_URL_or_Variable)

    Then parse out this section:

    <tr class="in">
    <th scope="row">In</th>
    <td>1466.9 kb/s (95.0%)</td>
    <td>94.6 kb/s (6.1%) </td>
    <td>58.0 kb/s (3.8%) </td>
    </tr>

    #######
    #Get the starting point of that section
    FindIndex = Find(Contents, "<tr class="in">")
    TempSect = SubStr(Contents, (FindIndex) )
    #Get the ending point of that section
    FindIndex = Find(TempSect, """</tr>")

    #Now you have the section to narrow down
    TempSect = SubStr(TempSect, 1, (FindIndex - 1) )

    #Get the Temp
    FindIndex = Find(TempSect, "<td>")
    Temp = SubStr(TempSect, (FindIndex + 5) )
    FindIndex = Find(Temp, """</td>")
    Temp = SubStr(Temp, 1, (FindIndex - 1) )

    That should give you the data in that temp line, then you just need to write that variable to the registry
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  5.    #5  
    Thanks,

    The format of data generated by our MRTG (Multi-Router Traffic Grapher)process is the same/simular no matter what device or data we are charting. By the way this is a webpage: (http://www....) not a local file in WM5.

    Do you have to write to registry, or can I display this info in that temp line to today screen plugin - or do today plugins look to the reg. values.

    I guess I need to do some more MortHomework.

    If anyone else can give guidance, it would be greatly appreciated! For here I need to display the data in a single line on the today screen and refresh this data every 10 or X number of minutes.

    Thanks for the head start!
    Last edited by Interstink; 06/01/2007 at 12:18 PM.
  6.    #6  
    Looks like I had to change the code slightly - Errors. But got it to display the raw text from the HTML file. The range its displaying is off, but at least im getting somewhere.

    Trying to narrow it down to only the values, but it displays the table (</td>) code as well. Im sure I can strip that out.

    Thanks again!
  7. #7  
    Quote Originally Posted by Interstink View Post
    Thanks,

    The format of data generated by our MRTG (Multi-Router Traffic Grapher)process is the same/simular no matter what device or data we are charting. By the way this is a webpage: (http://www....) not a local file in WM5.
    ReadFile can read from URLs too

    Quote Originally Posted by Interstink View Post
    Do you have to write to registry, or can I display this info in that temp line to today screen plugin - or do today plugins look to the reg. values.

    I guess I need to do some more MortHomework.
    To write to the carrier line or zbop's Today plugin you need to write the data to the registry, and the value in the registry is displayed.

    Since you own a 750, this is the reg entry you would write to to show it in the carrier line is:

    RegWriteString ("HKLM","System\State\Phone","Current Operator Name", Temp)

    Quote Originally Posted by Interstink View Post
    If anyone else can give guidance, it would be greatly appreciated! For here I need to display the data in a single line on the today screen and refresh this data every 10 or X number of minutes.

    Thanks for the head start!
    For this you basically can use a while loop like this:

    While(1)

    # Copy and paste the code I listed above

    RegWriteString ("HKLM","System\State\Phone","Current Operator Name", Temp)

    Sleep(600000)
    EndWhile
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  8. #8  
    Quote Originally Posted by Interstink View Post
    Looks like I had to change the code slightly - Errors. But got it to display the raw text from the HTML file. The range its displaying is off, but at least im getting somewhere.

    Trying to narrow it down to only the values, but it displays the table (</td>) code as well. Im sure I can strip that out.

    Thanks again!
    Yeah, might have been a little off, but you can just add/subtract numerical values to get the exact data you want.
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  9.    #9  
    Thanks again!!!

    Got the data!!! Now I need to make it into a today plugin... Tried zbop's billboard today plugin usage and it creates reg entry but no plugin in list. Will continue to work on this one...
    Last edited by Interstink; 06/01/2007 at 06:16 PM.

Posting Permissions