Go Down

Topic: Extract data from weather service? (Read 1 time) previous topic - next topic


Hi all,

I need help in understanding how to extract the data from a weather service. Is using the GET command the way to go?

Copied from recent post:
Code: [Select]
client.println("GET /search?q=http://weather.yahooapis.com/forecastrss?w=4118&u=c HTTP/1.0");

Any help or tips most welcomed.


What does the rest of your code look like?

What output do you get when you make that request?


This started from another topic (see link> http://arduino.cc/forum/index.php/topic,91667.msg688439.html#msg688439

I'm not that far along yet.

I was using some example code for the Ethernet shield in order to get an understanding of the GET command. Member (dhunt) pointed me to a free weather service when I made a comment that that was where I was headed.

Small steps at this time, otherwise I will be totally lost.

However, I will try and see what happens.


Small steps at this time, otherwise I will be totally lost.

Absolutely the best way to go. Make a change. See what effect that has. Make another change, See what you screwed up this time.

Presumably, though, the sketch you are modifying already does a get and prints the data sent back by the server. I would think that changing the GET command would be an easy change to make and test. But, take your time, and understand what you are doing. There's no rush. We'll be here.

Are you done yet?


Thanks Paul,

Not quite (working night shift this week, brain a little fussy) :smiley-sleep:

Has anybody use the GET command that can post some examples or links?



Feb 14, 2012, 02:08 am Last Edit: Feb 14, 2012, 02:39 am by Arne Reason: 1
Okay here it is:

Note: the code used to get this output is from zoomkat that I modified:
Better client test 12/01/11
Send an e in serial monitor to test
HTTP/1.0 404 Not Found
Date: Tue, 14 Feb 2012 00:55:01 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAOO...shortened...LOC GOV"
Cache-Control: private
Vary: Accept-Encoding
Content-Type: text/html; charset=utf-8
Age: 0
Server: YTS/1.20.0

<meta http-equiv="refresh" content="10;url=/">

etc, etc....

I feel like I just jumped into the middle of a forest

But, I got something  :~


But, I got something

Not really. You got an error message.
HTTP/1.0 404 Not Found

You'll need to pay attention to the changing URL in the address bar as you enter data or whatever when you go to http://developer.yahoo.com/weather/ to determine what the GET command should look like. The search$q= part clearly doesn't belong in the GET command.


Not really. You got an error message.

Okay, that helps.

I took out the search stuff.
Still came back with "404 not found" but why connected?
Maybe... connected because server is there but not the info/file... is that close?
Do you know of any simple examples.


The below might be of interest.

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


Nice link Zoomkat, I will have to print that one off.
Thank You

I came across some other info that I will link here so that I don't lose it.
Code 200 OK http://www.w3.org/Protocols/HTTP/1.0/spec.html#Code200
and GET http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3


Maybe... connected because server is there but not the info/file... is that close?

That's exactly what the message means. If the server was invalid, you'd get a different message, in the 500 range.

If the server was there, and the file existed, but you didn't have permission to read it, you'd get a different message (403).

Do you know of any simple examples.


The weather site that you were directed to has directions on it for figuring out what values to append to the URL to get weather for your area. If you are having trouble forming the request, tell us what area you want weather for, and well help.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131