ThingTweet App

The ThingTweet App lets you to update a Twitter status via ThingSpeak. Twitter requires Open Authentication (OAuth), which is difficult for a low level device to interface with. ThingTweet acts a Twitter proxy, so the device can use Twitter by making simple API calls.

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.json.xml
     api_key=XXXXXXXXXXXXXXXX
     field1=73
     twitter=thingspeaktest
     tweet=I just posted this from my thing!

Related Links