TweetControl

Updated ThingSpeak Documentation is now located in ThingSpeak Docs. For support, use the ThingSpeak Forum.

 
The TweetControl App allows you to create a social control based on your Twitter username and a specific hashtag. This app uses the Twitter Streaming API, so control is in real-time. You can use this app to control things or send data to external APIs by sending a ThingHTTP request. Anything that ThingHTTP can connect to, you can connect a Twitter hashtag to.
Why use TweetControl? Our app connects to the Twitter Streaming API. What this means to you is that you don’t have to keep polling Twitter for status updates. You can sit back and let TweetControl listen and then process the request when a trigger word gets fired. This happens in real-time and it’s quite remarkable to see in action.
TweetControl App by ThingSpeak

Create a ThingHTTP Request

The first step is to create a ThingHTTP request. ThingHTTP allows you to proxy connection to anything that supports the HTTP protocol. You can make a ThingHTTP request that will call someone via Twilio’s HTTP-based API or control ioBridge devices  or connect to a thermostat that accepts HTTP requests.

Replacements Keys

Use these keys to access the data from a TweetControl:

  • %%status%% – This is the full text of the tweet that was received by TweetControl
  • %%trigger%% – This is the word that triggered the TweetControl to be processed

Create a TweetControl

Once you have a ThingHTTP request that you want to control, you now need to link that request to a Twitter hashtag.

  • Sign into ThingSpeak
  • Select Apps
  • Select TweetControl
  • Click Create New TweetControl
  • Check Anonymous if you want anyone to be able to trigger your TweetControl
  • Fill in your Twitter screen name if you want it tied to only one Twitter user
  • Enter a hashtag to listen for (ex. #turnlightson)
  • Select a ThingHTTP Request to execute
  • Click Create New 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 hastag.
Tweet Structure:
[cce](filter) (trigger)[/cce]
It’s important to note that the filter keyword must also be present with your trigger in order for TweetControl to execute.
Sample Tweet:
[cce]#thingspeak #trigger[/cce]
TweetControl Sample Tweet

Filters

Filters are not case-sensitive.
You can filter tweets with the following keywords:

  • #thingspeak
  • thingspeak
  • #tweetcontrol
  • tweetcontrol
  • #iobridge
  • iobridge
  • #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

This example will update a ThingSpeak Channel with data from Twitter. It will update “field1” with the word that triggered the TweetControl and add the full text of the Tweet to the “status” field of the channel.

Create ThingHTTP Request

Name it “ThingSpeak Channel Updater”

  • URL: http://api.thingspeak.com/update
  • Method: POST
  • Body: key=(ThingSpeak Write Key)&field1=%%trigger%%&status=%%status%%

Create a TweetControl

  • Check Anonymous TweetControl
  • Enter “love” in the Trigger field
  • Under ThingHTTP Action select “ThingSpeak Channel Updater”
  • Click Update TweetControl

Send a Tweet

  • Using Twitter send “I love TweetControl”.

Go check your ThingSpeak Channel feed and you should see a new entry.
The reason that “I love TweetControl” works is because “TweetControl” is a valid filter keyword, and love is a matched trigger.

Projects

You could use this for many projects.
Here are some ideas:

  • Printing Tweets with a thermal printer
  • Twitter Voting Machine
  • Twitter Controlled Toy

CheerLights

CheerLights by ioBridge Labs uses TweetControl to update a ThingSpeak Channel with Tweets from Twitter. Then, users subscribe to the ThingSpeak API and set the color of their lights to the last color received. All of the lights stay in sync with each other.

10 comments

  1. I think this is a great technology. What would be great is a little more detail on how to make it work for people who are experimenting with Thingspeak.

    1. Agreed. I have a very cool idea but am running into some issues not knowing how to completely make it work. Great concept here, but I could use more step by step info.

      1. The rumor is that Hans is working on a detailed project that uses TweetControl. He will have a step-by-step procedure to show how he uses TweetControl.
        If you have any specific questions, let us know in the forum. We will be glad to assist in the meantime.

  2. Could you explain the Replacements Keys in a bit more detail? Do they stay written like this in the thingHTTP body &field1=%%trigger%%&status=%%status%% or do you replace the %%trigger%% with your actually trigger word established in your tweet control setup IE: &field1=%%love%%&status=%%status%%

    1. I tihnk you are on the right track. Yes, you keep them written as %%trigger%%. When we go to process the ThingHTTP request, we will replace the Replacement Keys with the actual trigger. And by “we”, I mean our API will replace them with the actual data.

  3. do you have any other example arduino sketches or know a good place to look? I would just like to better understand how to check a channel for an update and than set a pin high or low based on content of the update.

  4. Hello, how do i go about getting our own hashtag for the twitter control?
    regards

      1. hello Hans, with thanks you created my filter for my project, unfortunately i got my io-204 damaged somehow. i received my new ones but i do not seem make it work again. is my filter you created before still valid?
        regards

        1. You will need to update your ThingHTTP requests that point to the ioBridge API. Since you have a new IO-204, you have a new serial number. When you recreate your widgets, you will have new Widget IDs… enter these in the ThingHTTP requests.

Comments are closed.