ThingSpeak

ThingTweet App

Use the ThingTweet app to link a Twitter account to your ThingSpeak™ account. Your devices can then send alerts via Twitter® by using the TweetContol API. For example, you can make a device tweet you when the temperature in your greenhouse drops or when the batteries in a device are running low.

Associate Twitter Account

If you are logged into a Twitter account, ThingTweet automatically associates the available Twitter account to your ThingSpeak user account. Log out of Twitter to associate a different account.

  1. Sign In to ThingSpeak.

  2. Select Apps > ThingTweet.

  3. Click Link Twitter Account.

You are redirected to Twitter. When asked to authorize ThingTweet to use your account:

  • Enter your Twitter username and password.

  • Check the Remember me box to cache your Twitter credentials on your computer.

  • Click Authorize app.

When you confirm the Twitter account, Twitter sends you back to ThingSpeak.

The app generates a ThingTweet API Key for you to use. If you send a request to ThingTweet with your ThingTweet API Key and a message, the message is relayed to Twitter. All of the parameters from the Twitter API (statuses/update) are possible, including geo location.

Update Twitter Status

Include the ThingTweet API key and your status message to send a tweet using ThingTweet.

Example

To update your Twitter status with ThingTweet, send an HTTP POST:

POST https://api.thingspeak.com/apps/thingtweet/1/statuses/update
     api_key=XXXXXXXXXXXXXXXX
     status=I just posted this from my thing!

The response will be 1 if the update was successful, and -1 if there was an error.

Update Twitter Status with Last Value

You can include %%channel_CHANNEL_ID_field_FIELD_NUMBER%% in your Twitter message. ThingTweet replaces it with the last value of the specified channel and field.

Example

To update your Twitter status with the last value from Channel 1417, field1, send an HTTP POST:

POST https://api.thingspeak.com/apps/thingtweet/1/statuses/update
     api_key=XXXXXXXXXXXXXXXX
     status=The current CheerLights color is %%channel_1417_field_1%%.

Update Twitter Status with a Channel Update

You can use your channel feed to update your Twitter status by specifying the twitter and tweet parameters.

Example

To update your Twitter status with a channel update, send an HTTP POST:

POST https://api.thingspeak.com/update
     api_key=XXXXXXXXXXXXXXXX
     field1=73
     twitter=thingspeaktest
     tweet=I just posted this from my thing!
Was this topic helpful?