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

Login:
Pass:
 
 

Page 3 of 7
Topic:
Replacement for Weather.com xml feed
This thread has 92 replies. Displaying posts 31 through 45.
Post 31 made on Saturday October 26, 2013 at 16:00
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
What exactly is the problem? Have you done any debugging? Tested the feed from a laptop/desktop computer?
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 32 made on Sunday October 27, 2013 at 10:50
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Hi Lyndel,

I've read from the weather.com website that the weather.com XML Data Feed
is retired. That's the reason for.
Do you have another solution because the feed was very useful in combination
with ScottGrimes .xcf ?
It would be nice to get a positive answer,

Regards, Fischi
Post 33 made on Sunday October 27, 2013 at 16:18
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
I read that too about 2 years ago. It may be retired but I am still able to get info using my config file. I am in the states so that may indeed make a difference.

I return to my original questions. What debugging has been done? Have you contacted Scott? Has link been tested outside of Pronto/Scott's config? When you used Scott's file, did you enroll in weather.com and create your own partner id?
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 34 made on Sunday October 27, 2013 at 16:58
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Hi Lyndel,
Scott wrote me that his Pronto-weather also don't wor anymore.
I tried it out with my PC and I could also get informations.
The Pronto debug shows :

ProntoScript error: SyntaxError: unexpected end of XML entity
Offending script: (untagged)
Offending line #5:Location:[Link: wxdata.weather.com]"

I have nothing changed in the script, it worked very good for a long time.

Hope we'll find the issue

Regards, Fischi
Post 35 made on Monday October 28, 2013 at 23:30
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
When I paste your link above with all parameters into Internet Explorer, here in the states, I am not seeing what XML entity might be bad. I do note, however, that the response does not have an XML preprocessor instruction at the beginning.


Here's to hoping that Scott can find a solution.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 36 made on Thursday October 31, 2013 at 17:31
pjjameso
Long Time Member
Joined:
Posts:
April 2008
73
I too hope Scott can find a solution. Really enjoyed the weather forecasts on the pronto.
Paul
Post 37 made on Thursday November 7, 2013 at 09:56
nellie7979
Long Time Member
Joined:
Posts:
July 2008
75
Mine is still working without a problem. Located in the US.
Post 38 made on Thursday November 7, 2013 at 12:28
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
What is the difference between the US. location and another location
of the world (like Germany) that the weather.com xml feed works or works
not ?
There is the same Internet address to receive the data from !

Regards, Fischi
Post 39 made on Thursday November 7, 2013 at 19:21
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
It is the destination IP that may be filtered/rejected.

I equate this to being just like me trying to shop certain websites or access certain sites like Linn Records may not be possible if using an IP from the US.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 40 made on Saturday November 9, 2013 at 10:52
hulmem
Lurking Member
Joined:
Posts:
December 2011
2
Not working here in Spain or via my UK VPN connection - went off a couple of weeks ago.
Mark Hulme
Post 41 made on Sunday November 10, 2013 at 06:56
fredokl
Lurking Member
Joined:
Posts:
January 2010
9
The weather does not work in France. The xml file is not working.
Post 42 made on Sunday November 10, 2013 at 14:22
pjjameso
Long Time Member
Joined:
Posts:
April 2008
73
Found another web address for weather xml but having problems porting back to the original code. It appears that I am not receiving all the data from the initial GET request and then hangs as its looking for variables. Only a guess as I dont have much experience coding. Would appreciate if someone could look at an give me a push in the right direction. Have included the code below and the debugger output along with the web page.

var debug = true;
System.setDebugMask(debug ? 9 : 0);

// DEFINE GLOBAL VARIABLES

// Check if a value is stored for temporary units for weather
// If not, set it to the one stored in weather parameters page
if (System.getGlobal('TempUnits') == null)
{
System.setGlobal('TempUnits', (CF.widget("Units", "PARAMETERS", "WEATHER_FORECAST").label));
};

// DEFINE ACTIVITY VARIABLES

var socket;
var xmlData; // Stores xml data received from xml.weather.com
var CityCode = CF.widget("City1Code", "PARAMETERS", "WEATHER_FORECAST").label;
var City = 1;

// DEFINE FUNCTIONS

function onConnect()
{
if (socket && socket.connected == false)
{
// Not sure why onConnect() is called when socket is not connected
return;
}

var request = "GET /wxdata/weather/local/";
request += CityCode;
request += "?cc=*&dayf=5"; // 5-day forecast
request += "&unit=" + System.getGlobal('TempUnits'); //Use units stored in TempUnits variable
request += "&prod=bd_select";
request += "&par=yahoowidgetxml HTTP/1.0 \r\n"

// Write request to get weather forecast
socket.write(request);
socket.write("HOST:wxdata.weather.com \r\n");
socket.write("\r\n");
socket.write("\r\n");
};

// This function is called when the xml data has been received
function onData()
{
xmlData += socket.read();

};

// This function is called when the socket is closed
function onClose()
{

var ut;

System.print("XML Data Received Raw =====================> " +xmlData);

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

var weather = new XML(xmlData);
System.print("Weather variable ============================>" +weather);

// Get units of measure - standard or metric
ut = weather.head.ut;

// Display temperature units
CF.widget("Degrees").label = ut;

// Display name of city based on city code data
CF.widget("CityName").label = weather.loc.dnam;

// Display current temperature
// (remove ';//" and the text between the brackets below if you want to display C or F)
CF.widget("Temp").label = weather.cc.tmp + "°"; // + weather.head.ut;

// Update today's forecast
var text = weather.cc.t;
var hi = weather.dayf.day[0].hi;
var low = weather.dayf.day[0].low;
var icon = ""+weather.dayf.day[0].part[0].icon; // Force it to be a string

// Display Severe Weather Alert
try {
var swa0 = weather.swa.a[0].t;
var swa1 = weather.swa.a[1].t;
var swa2 = weather.swa.a[2].t;

}
catch (e) {
var swa0 = "";
var swa1 = "";
var swa2 = "";
}

CF.widget("SWA0").label = swa0;
CF.widget("SWA1").label = swa1;
CF.widget("SWA2").label = swa2;
//System.print("Severe Weather Alert: " +swa);

CF.widget("Text").label = weather.dayf.day[0].part[0].t;

// Update high temperature; if not available, omit temperature unit
// (remove ';//" and the text between the brackets below if you want to display C or F)
CF.widget("tp00").label = hi + "°"; // + weather.head.ut;
if (hi == "N/A")
{
CF.widget("tp00").label = hi;
icon = ""+weather.dayf.day[0].part[1].icon;
CF.widget("Text").label = weather.dayf.day[0].part[1].t;

}

// Update low temperature
// (remove ';//" and the text between the brackets below if you want to display C or F)
CF.widget("tp01").label = low + "°"; // + weather.head.ut;

// Set icon
var w = CF.widget("tp02");
w.setImage(CF.widget(icon, icon, "WEATHER_FORECAST").getImage());
w.label = "";

// Once weather data is updated, change activity label back to standby
CF.activity().label = "standby mode...";

// Note that the socket is killed after it has been closed and
// will need to be recreated.
socket = null;
};

function onIOError(e)
{
System.print(e);
};

function connectWeather(City)
{
CityCode = CF.widget("City" + City + "Code", "PARAMETERS", "WEATHER_FORECAST").label;

if(socket == null) // socket was cleared by onClose()
{
// create new asynchronous TCP socket
socket = new TCPSocket(false);

// setup socket functions
socket.onConnect = onConnect;
socket.onData = onData;
socket.onClose = onClose;
socket.onIOError = onIOError;

xmlData = "";

socket.connect('wxdata.weather.com', 80, 3000);
}
}

==================================
Note *  sub for <


Offending line #62: "    var weather = new XML(xmlData);"
Offending activity script: Tag: 'HOME'
ProntoScript error: SyntaxError: syntax error
        *t>Fire Weathe
      */a><a id="740981" uc="3">
        *l>[Link: weather.com];
        *t>Special Weather Statement</t>
        *a id="736147" uc="2">
        *swa>
        
    */loc>
      *zone>-5</zone>
      *suns>4:59 PM</suns>
      *sunr>6:47 AM</sunr>
      *lon>-77.29</lon>
      *lat>39.00</lat>
      *tm>2:24 PM</tm>
      *dnam>Great Falls, VA</dnam>
        *loc id="USVA0324">
    */head>
      *ur>in</ur>
      *up>in</up>
      *us>mph</us>
      *ud>mi</ud>
      *ut>F</ut>
      *form>MEDIUM</form>
      *locale>en_US</locale>
        *head>
*weather ver="2.0">


Connection: close

Content-Length: 5078

Date: Sun, 10 Nov 2013 19:24:16 GMT

Cache-Control: max-age=278

X-Cache-Hits: 0

X-Varnish: 2194322075

Content-Type: text/xml;charset=UTF-8

Server: Apache-Coyote/1.1

XML Data Received Raw        =====================> HTTP/1.0 200 OK

adding dns 192.168.1.1
route: SIOCDELRT: No such process
deleting routers
Lease of 192.168.1.15 obtained, lease time 86400
Sending select for 192.168.1.15...
=============================

//[Link: wxdata.weather.com]

Last edited by pjjameso on November 10, 2013 14:50.
Paul
Post 43 made on Thursday November 14, 2013 at 17:20
gopronto
Senior Member
Joined:
Posts:
April 2008
1,453
to make it easy for every one could someone just drop a copy of the new working script on the RC site :)
Pronto still one of the best Wi-Fi Remotes,
www.ikonavs.co.nz and [Link: axiumcontrol.com] Axium Control
Post 44 made on Thursday November 14, 2013 at 18:25
n2hifi
Long Time Member
Joined:
Posts:
August 2007
192
I have a new working script and I have been trying to get some time to post it. There was a change in the path which now points to wxdata.weather.com. They also changed the way the 'day0' tag works. There is no longer a weather.dayf.day[0].part[0] (or at least in the evening). I will try to have something posted by the weekend.
Mark Olsen, CTS
Cannon Design
Post 45 made on Thursday November 14, 2013 at 21:44
pjjameso
Long Time Member
Joined:
Posts:
April 2008
73
Thanks Mark...
Paul
Find in this thread:
Page 3 of 7


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse