HELP! Fan control with Google Weather API

Hi,
I recently started working with Arduino and I'm very overwhelmed. I have a college project which is fairly difficult and I am in desperate need of help for it as the deadline is in 7 days. What I'm trying to do is control a fan or maybe two based on the wind information that Google's weather API gives. So far I have managed to use an ethernet shield to connect to the API and display the XML results in Arduino's serial monitor. What I want to do now is parse the XML so it reads the wind information specifically, then bases the output to the fan on this wind speed.
Here is the code I have used to connect to the API (actually got it off this forum I think):

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 177 };
byte server[] = { 173, 194, 33, 104 }; // Google

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);

void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");

// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /ig/api?weather=Kinsale HTTP/1.0");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}

void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}

// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();

// do nothing forevermore:
for(;:wink:
;
}
}

That's all well and good but trying to parse that XML, well I have no idea. I tried experimenting with other scripts I found online but to no success. REALLY STUCK. I have only relatively basic understanding of the language, but if something is documented well as it goes along I can follow.

Any help would be appreciated.

How firm is the problem definition? Specifically, the partitioning of application functionality between Arduino and server?

An alternative partitioning would be to write a small server-side script to call the weather API and format the results into something the Arduino can parse more easily than XML. But it may not be permitted.

-br

http://entropymouse.com

This is the code that gets one letter at a time from the response, and displays it to the serial monitor.

 if (client.available()) {
   char c = client.read();
   Serial.print(c);
 }

Storing that character in an array in addition to printing it is easy enough. Adding that character to a String object is even easier, although more wasteful.

Using the String object's indexOf and substring methods will allow you to locate specific data, it the data is well-defined.

Extracting the character data from the (sub-)String object, using the toCharArry() member is easy.

Converting that character array to an integer, using atoi() is trivial.

Then, you have a number to use to control the fan.

You could try capturing all the data to a string for parsing, but there may be too much to do that. If that is the case, you may be able to make a series of nested test to find the point in the string of data to start capturing. As the characters are received one at a time, the test would need to determine when Wind: has been encountered in the stream of characters, then capture the wind data from that point. You can select the data received in the serial monitor, use ctrl-c to copy, and paste in notepad to see the total material being received by the arduino.