This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

TweetControl App

Use the TweetControl app to respond to tweets with a specified trigger word and send an HTTP request using the ThingHTTP app. The action specified in your ThingHTTP code is executed when the trigger word appears in a tweet.

The TweetControl App enables you to create a social control based on your Twitter® username and a specific hashtag. This app uses the Twitter Streaming API, which gives you real-time control. You can use this app to control embedded devices (things) or send data to external APIs by sending a ThingHTTP request.

TweetControl listens and processes the TweetControl request each time it comes across the trigger word. It eliminates the need to continually poll Twitter for status updates.


Set Up Control

Create a ThingHTTP Request

ThingHTTP enables you to proxy-connect to anything that supports the HTTP protocol. You can set up a ThingHTTP request to call someone via Twilio®’s HTTP-based API, control devices, or connect to a thermostat that accepts HTTP requests.

Replacements Keys.  Use these keys to access the data from a TweetControl:

  • %%status%% – Full text of the tweet that was received by TweetControl

  • %%trigger%% – The trigger defined in the TweetControl

Create a TweetControl

Link a ThingHTTP request to a Twitter hashtag.

  1. Sign into ThingSpeak™.

  2. Select Apps > TweetControl.

  3. Click New TweetControl.

  4. Check the Anonymous TweetControl box to enable anyone to trigger this TweetControl.

  5. Twitter Account: Enter a Twitter username to tie the control to one specific Twitter user.

  6. Trigger: Enter the trigger word preceded by a hashtag. For example, #turnlightson.

  7. ThingHTTP Action: Select a ThingHTTP to run.

  8. Save the TweetControl.

Send a Tweet: Control the World

To execute the ThingHTTP command, send a tweet from your Twitter account with a filter and your trigger hashtag.

Tweet Structure


The filter keyword must be included with your trigger to execute your TweetControl.

Sample Tweet

#thingspeak #trigger


Filters are not case sensitive and do not require the hashtag (#). Use these keywords to filter tweets:

  • #thingspeak

  • thingspeak

  • #tweetcontrol

  • tweetcontrol

  • #cheeerlights

  • cheerlights


If you have a project that you want to use TweetControl with and want your own filter keyword, let us know and we will add it our service.

Example: Update Channel Field with Trigger

This example shows how to update a ThingSpeak channel "field1" with data from Twitter with the word that triggered a TweetControl. It adds the full text of the Tweet to the “status” field of the channel.

Create a ThingHTTP Request

Create a ThingHTTP to handle your request, and name it "ThingSpeak Channel Updater"

  • URL: Enter

  • Method: Select POST.

  • Body: Enter api_key=THINGSPEAK_WRITE_KEY&field1=%%trigger%%&status=%%status%%.

Create a TweetControl

  • Check the Anonymous TweetControl box.

  • Enter "love" in the Trigger field.

  • Select "ThingSpeak Channel Updater" in the ThingHTTP Action field.

  • Save your TweetControl.

Send a Tweet

  • Use the specified Twitter account to tweet:

    "I love TweetControl"

Check your ThingSpeak channel to see the new status entry.

"TweetControl" is a valid filter keyword, and "love" matches the trigger.

Project Suggestions

Following are some TweetControl project ideas:

  • Printing tweets with a thermal printer

  • Twitter voting machine

  • Twitter controlled toy

CheerLights Example

CheerLights is a project that uses TweetControl to update a ThingSpeak Channel via Twitter. Users subscribe to the ThingSpeak API, which sets the color of their lights to the last color received. Lights around the world display the same color.

Was this topic helpful?