Twitter is one of the most popular SNS service. Recently, many people tries to make a device that sends or receives the tweet messages.
This posting provides the guide how you can make that kind of device by using WIZwiki-W7500 mcu platform board.
As the OAuth authentication has been applied to tweet message transmission method, it is not easy for the embedded device to send the message to the tweet directly. So, as you see below image, we must use the Proxy solution. This solution enables you to make a Twitter App to process the OAuth and deliver the data to any tweet account.
If you click “Step 1”, you can go to the page to get a token to access the app.
With this token, you can send the message to your tweet account. By adding the token to the Arduino source, you can enable the Arduino to send the tweet message.
The embedded board can send the tweet message just by accessing the Tweet Proxy service. Only simple HTTP Client is required instead of complicated OAuth.
How to tweet with Node.js
If you click the below link, you could get the code to send the tweet message with Node.js.
We need to change the above code for the embedded board to send the token key.
Firstly please modify the ‘app.js’ code as below.
After then, the IoT board just calls the specific page of the web server. (In this posting, it calls the HTTP with http://[IP Address]:3000/twitter/tweet)
If you touch the sensor, the board connects to the Proxy server and request to send the tweet message
Below is the output log
if you open the tweet with your account, you can see the updated message.