getSting(?????) help with RSS reader project

I've been struggling to get an RSS reader to get text from Google weather following the example from "SimpleClientGoogleWeatherDHCP". I've been able to get integers pretty easily but I'm unable to get the text from the following xml page:

<current_conditions>

<temp_f data="36"/>
<temp_c data="2"/>


<wind_condition data="Wind: SW at 6 mph"/>
</current_conditions>

My code:

/*
 * SimpleClientGoogleWeatherDHCP
 * gets xml data from http://www.google.com/ig/api?weather=milwaukee,wi
 * reads temperature from field:  <temp_f data="66" /> 
 * writes temperature  to analog output port.
 */

#if ARDUINO > 18
#include <SPI.h>         // needed for Arduino versions later than 0018 
#endif

#include <Ethernet.h>
#include <EthernetDHCP.h>  // uses DHCP code from: http://blog.jordanterrell.com/post/Arduino-DHCP-Library-Version-04.aspx 
#include <TextFinder.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(26, 24, 22, 23, 25, 27, 29);

int backLight = 28;    // pin 28 will control the backlight
byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x00, 0x8F, 0xD3 };
byte server[] = {
  209,85,229,104 }; // Google

Client client(server, 80);

TextFinder  finder( client );  
[glow=yellow,2,300]char cond[40];[/glow]
void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(20,4);
  lcd.setCursor(0,0);
  lcd.print("I'm alive");
  if(EthernetDHCP.begin(mac)) {
    // begin method returns 1 if successful  
    lcd.setCursor (0,1);
    lcd.print("got IP address, connecting...");
    lcd.clear();
    delay(500);  
  }
  else {
    lcd.clear();
    lcd.print("unable to acquire ip address!");
    while(true)
      ;  // do nothing
  }
}


void loop()
{
  if (client.connect()) {
    client.println("GET http://www.google.com/ig/api?weather=milwaukee,wi");  // google weather for London
    client.println();
  } 
  else {
    lcd.println("I'm dead Jim");

  } 
  if (client.connected()) {
    finder.find("<temp_f data=");
    int temperature = finder.getValue();
    lcd.clear();
    lcd.print("Temperature = ");
    lcd.print(temperature);
    delay(3000);
    lcd.clear();
    lcd.print("High Temp ");
    finder.find("<high data=");
    int temp = finder.getValue();
    lcd.print(temp);
    delay(3000);
    lcd.clear();
    lcd.print("Current Conditions ");
    [glow=yellow,2,300]finder.find("<condition_data=");[/glow]
    finder.get(cond,40);
    lcd.setCursor(0,2);
    lcd.print(cond);

  }
  else {
    lcd.clear();
    lcd.print("Oh intercourse the penquin");

  }
  client.stop();
  client.flush();  
  delay(2000); //

lcd.print("Oh intercourse the penquin");

It might not really be necessary to discuss your sex life on the forum. Not that there's anything wrong with penguins...

I'm unable to get the text from the following xml page:

That code does something. You don't say what.
You want it to do something. You don't say what.

Presumably, there is a difference between the two. You don't say what.

It's pretty hard to help you resolve the problem with so little information.

This is the Google XML output from Google

<current_conditions>

<temp_f data="36"/>
<temp_c data="2"/>


<wind_condition data="Wind: SW at 6 mph"/>
</current_conditions>

I'm trying to strip off the text from (the word Cloudy)

This is my arduino code:
lcd.print("Current Conditions ");
finder.find("<condition_data=");
finder.get(cond,40);
lcd.setCursor(0,2);
lcd.print(cond);

I have a problem with the highlighted line...

How much more information do you need?

"Intercourse the penguin" is from Monty Python's - Penguin on the Tele sketch.

Some old client code that gets weather data by knowing where it will be in the page.

//zoomkat 12-22-10
//simple ethernet client test code
//for use with IDE 0021 and W5100 ethernet shield
//modify the arduino lan ip address as needed
//open serial monitor to see what the arduino receives
//push the shield reset button to run client again

#include <SPI.h>
#include <Ethernet.h>
String readString, readString1;
int x=0;
char lf=10;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 102 };
byte server[] = { 140, 90, 238, 27 }; // NOAA

Client client(server, 80);

void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  Serial.println("starting simple arduino client test");
  Serial.println();
  Serial.println("connecting...");

  if (client.connect()) {
    Serial.println("connected");
    client.println("GET /data/5day2/44013_5day.txt HTTP/1.0");
    client.println();
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
    //Serial.print(c);  // uncomment to see raw feed
    if (c==lf) x=(x+1);
    if (x==14) readString += c;
    //readString += c;
  }

  if (!client.connected()) {
     client.stop();

    Serial.println("Current data row:" );
    Serial.print(readString);
    Serial.println();
    readString1 = (readString.substring(41,43));
    Serial.println();
    Serial.print("DPD sec: ");
    Serial.println(readString1);
    Serial.println("done");

    for(;;);

    }
 }

I have a problem with the highlighted line...

How much more information do you need?

We need to know WHAT the problem you have is. Is it just that you personally dislike that line? Is it the penguin that doesn't like it?

I was able to get the Google weather example to do more than just output integers. The code below gets Milwaukee weather data including text descriptions from Google The original example only pulls integers for temp.

Here's the working code:

/*
 * Based on SimpleClientGoogleWeatherDHCP - This one comes with High Temp and Current conditions data.
 * gets xml data from http://www.google.com/ig/api?weather=milwaukee,wi
 * reads temperature from field:  <temp_f data="66" /> 
 * writes temperature  to 20x4 LCD. Using Ardiuno Mega 2640
 */

#if ARDUINO > 18
#include <SPI.h>         // needed for Arduino versions later than 0018 
#endif

#include <Ethernet.h>
#include <EthernetDHCP.h>  // uses DHCP code from: http://blog.jordanterrell.com/post/Arduino-DHCP-Library-Version-04.aspx 
#include <TextFinder.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(26, 24, 22, 23, 25, 27, 29);

int backLight = 28;    // pin 28 will control the backlight
byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x00, 0x8F, 0xD3 };
byte server[] = {
  209,85,229,104 }; // Google

Client client(server, 80);

TextFinder  finder( client );  
char cond[40];
void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(20,4);
  lcd.setCursor(0,0);
  lcd.print("I'm alive");
  if(EthernetDHCP.begin(mac)) {
    // begin method returns 1 if successful  
    lcd.setCursor (0,1);
    lcd.print("got IP address, connecting...");
    lcd.clear();
    delay(500);  
  }
  else {
    lcd.clear();
    lcd.print("unable to acquire ip address!");
    while(true)
      ;  // do nothing
  }
}


void loop()
{
  if (client.connect()) {
    client.println("GET http://www.google.com/ig/api?weather=milwaukee,wi");  // google weather for Milwaukee
    client.println();
  } 
  else {
    lcd.println("Can not connect to Google Weather");

  } 
  if (client.connected()) {
    finder.find("<temp_f data=");
    int temperature = finder.getValue();
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Temperature = ");
    lcd.print(temperature);
    delay(3000);
    lcd.setCursor(0,1);
    lcd.print("High Temp ");
    finder.find("<high data=");
    int temp = finder.getValue();
    lcd.print(temp);
    delay(3000);
    lcd.setCursor(0,2);
    lcd.print("Current Conditions ");
    finder.find("<condition data");
    finder.getString("=","/",cond,(40));
    lcd.setCursor(0,3);
    lcd.print(cond);

  }
  else {
    lcd.clear();
    lcd.print("Can not find xml tag");

  }
  client.stop();
  client.flush();  
  delay(4000); // wait a minute before next update
}

Moderator: And there's the code posted correctly. BTW, OP, What have you got against Mr Sumner?

...and here's the code working with the 1.0 environment.

/*
 * Based on SimpleClientGoogleWeatherDHCP - This one comes with High Temp and Current conditions data.
 * gets xml data from http://www.google.com/ig/api?weather=milwaukee,wi
 * reads temperature from field:  <temp_f data="66" /> 
 * writes temperature  to 20x4 LCD. Using Ardiuno Mega 2640
 */

#if ARDUINO > 18
#include <SPI.h>         // needed for Arduino versions later than 0018 
#endif

#include <Ethernet.h>
#include <TextFinder.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(26, 24, 22, 23, 25, 27, 29); 
//LCD Pinout is: PIN 1 is VSS TO GND, PIN 2 is VDD 5v, PIN 3 is V0 TO GRN) PIN 4 is RS, PIN5 is RW, PIN6 is E, DB Pins 4 thru 14 (PINS 7 - 10 (DB 0 - DB 3 OPEN) Pin 15 backlight 
//16 backlight ground
int backLight = 28;    // pin 28 will control the backlight
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x8F, 0xD3 };
byte ip[] = { 10, 0, 0, 169 };
byte server[] = {
  209,85,229,104 }; // Google

EthernetClient client;

TextFinder  finder( client );  
char cond[40];
char fcond[40];
char wind[25];
int forelow1;
int forehigh1;
void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(20,4);
  lcd.setCursor(0,0);
  lcd.print("I'm alive");
  Ethernet.begin(mac, ip);
}

void loop()
{
  if (client.connect(server, 80)) {
    client.println("GET http://www.google.com/ig/api?weather=milwaukee,wi");  // google weather for Milwaukee
    client.println();
  } 
  else {
    lcd.println("Can not connect to Google Weather");

  } 
  if (client.connected()) {
    finder.find("<condition data");
    finder.getString("=","/",cond,(40));
    finder.find("<temp_f data=");
    int temperature = finder.getValue();
    finder.find("<wind_condition data=");
    finder.getString(":","/",wind,(40));
    finder.find("<low data=");
    forelow1 = finder.getValue();
    finder.find("<high data=");
    forehigh1 = finder.getValue();
    finder.find("<condition data");
    finder.getString("=","/",fcond,(40));
    //Print this    
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Currently:");
    lcd.setCursor(0,1);
    lcd.print("Temperature = ");
    lcd.print(temperature);
    lcd.setCursor(0,2);
    lcd.print("Wind:");
    lcd.print(wind);
    lcd.setCursor(0,3);
    lcd.print(cond);
    delay(4000);
    lcd.clear();
    lcd.print("Tomorrow: ");
    lcd.setCursor(0,1);
    lcd.print("Expected Low: ");
    lcd.print(forelow1);
    lcd.setCursor(0,2);
    lcd.print("Expected High: ");
    lcd.print(forehigh1);
    lcd.setCursor(0,3);
    lcd.print(fcond);  
    delay(4000);

  }
  else {
    lcd.clear();
    lcd.print("Can not find xml tag");

  }
  client.stop();
  client.flush();  
  delay(4000); // wait a minute before next update
}