React or ThingHttp to send tweet or all? | ThingSpeak Apps | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
React or ThingHttp to send tweet or all?
No permission to create posts
September 25, 2015
4:20 pm
New Member
Forum Posts: 2
Member Since:
September 25, 2015
sp_UserOfflineSmall Offline

I'm trying to send a tweet when certain conditions are met in the data in my feed. However I'm stymied by the fact that Twitter will only show a given Tweet once. React works well to send a tweet but if it sends it twice I only see the first one on Twitter. Variables such as %%Date%% will not work in a React.

Can anyone help?


September 25, 2015
4:59 pm

Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline


If you use %%trigger%% in your React, does that help to avoid sending the same tweet?


September 25, 2015
7:17 pm
New Member
Forum Posts: 2
Member Since:
September 25, 2015
sp_UserOfflineSmall Offline

I tried that but the data doesn't change enough, it's an on/off switch.

September 29, 2015
7:54 pm

Forum Posts: 279
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Perhaps this will work for you?

1. Set up your thingTweet and get the key.
2. Create a Matlab analysis with the code shown below, adding your channel ID, read api key and thingTweet key where shown.
3. Set up a React that triggers your matlab analysis.

You can customize the message by changing fmtstr

% add timestamp to data in order to bypass twitters 'no duplicates' policy

% TODO - Replace the [] with channel ID to read data from:
readChannelID = [YOUR_CHANNEL_ID];
% TODO - Enter the Read API Key between the '' below:

%% Read Data for field 1 of given channel %%
data = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey, 'Fields',1);
%% uncomment below to debug data
% disp(data)
thingTweetURL = '';
thingTweetApiKey = 'YOUR_THINGTWEET_KEY';
fieldName = 'status';
fmtstr='Sensor reading %0.1f at %s';
fieldValue = sprintf(fmtstr,data,datestr(datetime('now')));
response = webwrite(thingTweetURL,'api_key',thingTweetApiKey,fieldName,fieldValue)

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Sahil Nair, ahancity, samexpert, Senseworks, h-kasiri, kleifimmakly

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457