Display a message on the M5StickC screen when specific user tweets

Make things

When particular user tweets on Twitter, you will be notified on the M5StickC display.

Materials

You can install obniz OS on your M5StickC. → obnizOS installation

※It doesn’t matter with no power supply and no cable because M5StickC has its own battery. However, you should use the power supply if you want to run the program for a long time.

How to make

Hardware connection

Prepare an M5StickC obnizOS installed. No parts are needed.

Software

The program detects tweets through IFTTT. IFTTT is a web service that makes it easy to connect various web services and devices.

Setting up an obniz Event

Set up the obniz Event so that the program will be run when IFTTT calls the Webhook URL. Learn more about obniz Events here.

First, go to the official obniz website and enter the “Developer’s Console“.

Next, click on “Create New” in the left menu, paste and save the program.

You can name the file as you like. In this case, I tried it as a Tweet notification.

Next, click on Create New in the “Serverless Event” field to create an event.
Please refer to the following for details of the settings

Name (any)
Webapp to run Select the name of the program saved in the repository.
Trigger Webhook

 Click “Create“.

In the end, note the URL of “Endpoint” on this page. You will use this URL at “Make a recipe with IFTTT.”

Make a recipe with IFTTT

Make a recipe with IFTTT to call Webhook URL when particular user tweets on Twitter.

First of all, you need to access IFTTTT and log in. If you use IFTTTT for the first time, you will be asked to register as a member or log in through Google or Facebook.

If you can log in to IFTTT, click “create.” And click “This” part (we call it the trigger) of the “If This Then That.”

 

Type “twitter” in the search bar and select Twitter. Then select “New tweet by a specific user“.

Input the username you want to notify on “Username to watch.” (Please remove the @ mark.)

Next, click on the part of “That” (we call it the action).

Type “webhook” in the search bar and select Webhooks. Then, select “Make a web request“.

Set “URL” to the URL you have saved, “Method” to POST, “Content Type” to application/json, and “body” to {"tweet":true, "content":"{{Text}}"} and click “Create action“.

Compleated!

Program

How to use

If particular user tweets on Twitter, the notification of “New tweet!” and contents of the tweet will be displayed on M5StickC.

In this article, we used the Body to get the content of the tweet (Text), you can also get other information such as the user name (UserName).
Try changing the notification text and content to make the notification screen whatever you want it to be.