I created a thingspeak channel(feed) which monitors twitter streaming api for a trigger keyword. Every time a new tweet is posted with the trigger word my feed Channels - ThingSpeak IoT updated. I've got an arduino with an ethernet shield and I'm working on a sketch which sets a pin 13 high for 1 second when when a my feed receives a new update. However, i'm having issues in my loop. I start to get lost after client. available. Not sure how to parse results to see if there was an update. Here's where I'm at
void loop()
{
if (client.available() > 0)
{
delay(100);
String response;
char charIn;
do
{
charIn = client.read();
response += charIn;
}
while(client.available() > 0);
if (response.indexOf("gumball") > 0)
{
lastCommand = "gumball";
}
I guess I'm just looking for some direction. I've mashed up a lot of different samples to get to this point and now I'm over my head.
Full sketch here
thingspeak api