Update Twitter with ThingTweet and Arduino + Ethernet Shield
This tutorial explains how your Arduino via an Ethernet Shield can update a Twitter status using the ThingTweet App from ThingSpeak.
Setup ThingTweet
Sign in to https://thingspeak.com/login, select Apps from the menu, and then click on ThingTweet.
Under the ThingTweet App, select “Link new Twitter account”. This will redirect you to Twitter to see if you want the app to have the ability to access your account. You can Allow or Deny the process. Once you have confirmed the right Twitter account, Twitter will send you back to ThingSpeak.
The app generates a ThingTweet API Key for you to use. If you send an HTTP POST with your ThingTweet API Key, then the message will be relayed to Twitter. All of the parameters from the Twitter API (statuses/update) are possible including geolocation.
ThingSpeak API IP Address
The Arduino + Ethernet Shield does not have DNS by default, so you need to send data using an IP address. ThingSpeak has an API address dedicated for its API.
HTTP POST to ThingTweet
Here is an example HTTP POST to update a Twitter Status via ThingTweet:
ThingTweet Arduino Sketch [Arduino 1.0+]
This Arduino sketch uses ThingTweet to update a Twitter status via an Arduino and Ethernet Shield.
ThingTweet Arduino Sketch [Arduino 0023 or less]
This Arduino sketch uses ThingTweet to update a Twitter status via an Arduino and Ethernet Shield.








hi,
when i keep trying to verify the sketch, it says client has been renamed as EthernetClient
and when I change it to EthernetClient, it says no matching function for call to ‘EthernetClient::EthernetClient(byte [4],int)’
Any suggestions??
I just want this to tweet…
My first thought is that you are using a newer version of the Arduino IDE than when this tutorial was written. The above tutorial is for Arduino 0023 or less. We have been maintaining Arduino 1.0 on GitHub. Here is a link: https://github.com/iobridge/ThingSpeak-Arduino-Examples
Significant changes were made to the Ethernet Client in Arduino 1.0+ – this is why the sketch is failing.
Another tip, if the Arduino sketch ends in .pde – it is for the older IDE, and .ino is for Arduino 1.0+ IDE.
I will update the tutorial to show another example.
If I wanted the tweet sending to be controlled by an external signal, say a pushbutton, where should I insert the if statement? should I do it inside the first loop so
if (pushbutton ==1) {
updateTwitterStatus(“My thing is social @thingspeak”);
}
else
or should I do the whole void function conditionally?