Go Down

Topic: Reading Webpage data? (Read 726 times) previous topic - next topic

JustXtreme

is there a way for an arduino to search the content of a html page for a particular set of data then react?

PaulS

Quote
is there a way for an arduino to search the content of a html page for a particular set of data then react?

How is it going to get the html page? If you have an ethernet shield, and make a GET request as a client, then the html page will be spooled back, as text, which you can store and search to your hearts desire.

JustXtreme

perfect. that's what i wanted to hear.
thanx

JustXtreme

Can i split data or create any sort of arrays from it?
Exampe
if the output of the page contains a line
Count=4

can i create a variable in arduino from that piece of data.

PaulS

You read one character at a time from the client connection, so you can do whatever you want with that character - append it to a String object (lots of overhead) or put it in a character array (minimal overhead, but more bookkeeping).

Once you have the data, typically resetting the storage after some delimiter is read, such as a carriage return, you can parse the data.

If the entire web page consists of "Count=4", or the portion of interest at least, what does "can i create a variable in arduino from that piece of data" mean? Do you want to store "Count=4" in an array of characters (you can), or are you thinking that you can split it into parts, and create a variable called Count with a value of 4 (you can't, directly)?

JustXtreme

The entire page output would look something like this

bob:online
paul:offline
sam:online
count=3

the number of names and count number can change.

i want the arduino to be able to read the status of each person and trigger something based on the person and status.
and i would like to be notified if the count goes up, so i was wanting the arduino to be able to find the count number no matter where it is in the page.
i was thinking i could have the arduino search the content for "count=" then store what ever came after that as a variable.

Go Up