Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 1 made on Saturday May 5, 2012 at 18:04
Fistandantilus
Lurking Member
Joined:
Posts:
May 2012
4
Hi,

Since some years I´m using Pronto remotes. Now I´ve got a TSU7400 and starting to configure it.
As there seems to be no working weather script I started to adapt ScottGrimes version to my Pronto.
As I do not want to pay for weather.com I was looking for an alternative which google.com offers.
I already get XML back to my Pronto but reading the different segments is not working. Maybe someone could have a look into that.

Here the XML:

<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<forecast_information>
    <city data="Dresden, Saxony"/>
    <postal_code data="dresden"/>
    <latitude_e6 data=""/>
    <longitude_e6 data=""/>
    <forecast_date data="2012-05-05"/>
    <current_date_time data="1970-01-01 00:00:00 +0000"/>
    <unit_system data="SI"/>
</forecast_information>
<current_conditions>
    <condition data="Leichter Regen"/>
    <temp_f data="54"/>
    <temp_c data="12"/>
    <humidity data="Feuchtigkeit: 94 %"/>
    <icon data="/ig/images/weather/mist.gif"/>
    <wind_condition data="Wind: NO mit Windgeschwindigkeiten von 14 km/h"/>
</current_conditions>
<forecast_conditions>
    <day_of_week data="Sa."/>
    <low data="6"/>
    <high data="21"/>
    <icon data="/ig/images/weather/chance_of_storm.gif"/>
    <condition data="Vereinzelt stürmisch"/>
</forecast_conditions>
<forecast_conditions>...</forecast_conditions>
<forecast_conditions>...</forecast_conditions>
<forecast_conditions>...</forecast_conditions>
</weather>
</xml_api_reply>


This is the current code:

    // Trim the XML tag off if it was included.
    if (xmlData.indexOf("<?xml"))  
        xmlData = xmlData.substring(xmlData.indexOf("?>")+2);

    // DEFINE VARIABLES

    var weatherData = new XML(xmlData);
    //CF.widget("_PS_DEBUG_").label = weatherData; -> here I can see above posted XML data

    // Obtain the name of city based on city code data
    var locationText = "" + weatherData.forecast_information.city;  // Force it to be a string
    CF.widget("_PS_DEBUG_").label = weatherData.forecast_information.city;


-> getting no values displayed
also tried
CF.widget("_PS_DEBUG_").label = weatherData.weather.forecast_information.city;
CF.widget("_PS_DEBUG_").label = weatherData.weather[0].forecast_information.city;


Best regards,
F.
iPronto -> RU990 -> TSU7400


Hosting Services by ipHouse