i have got this from the twitter example and it looks like it does the job
///////
// add incoming byte to end of line:
currentLine += c;
// if you get a newline, clear the line:
if (c == '\n') {
currentLine = "";
}
// if the current line ends with <text>, it will
// be followed by the tweet:
if ( currentLine.endsWith("<name>")) {
// tweet is beginning. Clear the tweet string:
readingName = true;
name = "";
}
// if you're currently reading the bytes of a tweet,
// add them to the tweet String:
if (readingName) {
if (c != '<') {
name += c;
}
else {
// if you got a "<" character,
// you've reached the end of the tweet:
readingName = false;
Serial.println(name);
// lcd.setCursor(0,1);
// lcd.println(name);
// delay(1000);
// close the connection to the server:
}
}
Only thing i do not understand is that it returns from
John Doe
it gives
John Doe