The Trendy application is being retired in the new year. The new web application, ThingSpeak, offers similar functionality. We recommend that active Trendy users who are looking to create new trends use ThingSpeak. To begin collecting your data in ThingSpeak, please read the tutorial : ThingSpeak for Trendy users. Although Trendy no longer allows the creation of new trends, the application will still remain accessible until January 13, 2016. Until that date, you can view your current trends and download your data. After that date, your data will no longer be accessible. Thanks for using Trendy and we encourage you to check out ThingSpeak.

Close-button

Surprise Tweets/min

This trend is broken.

Emotion  Tweets/min, MinutesCovered
Error using urlreadwrite (line 92)
The server did not find a resource to match this request.

Error in urlread (line 36)
[s,status] = urlreadwrite(mfilename,catchErrors,url,varargin{:});

441

data points

Error

Description:

Scrapes Twitter to find "Mood of the World". This is based Twitter Mood Light project by RandomMatrix

Recently Collected Data (last 5 of 441) Show All Data

Time Recorded (time1234) Data (data1234)
19 May 2015 20:08:09 NaN
05 Jun 2013 06:00:17 NaN
04 Jun 2013 06:00:14 [1323.52934708774]
03 Jun 2013 06:00:14 [1383.69231879464]
02 Jun 2013 06:00:13 [1499.00008934737]
% Scrapes Twitter to find "Mood of the World".
% This is based 
% <http://www.instructables.com/id/Twitter-Mood-Light-The-Worlds-Mood-in-a-Box/ Twitter Mood Light> project by <http://www.instructables.com/member/RandomMatrix/ RandomMatrix>
% Note:  Trendy only runs this script 1/day
%        Twitter limits search results to ~1500 tweets
%        Therefore, this search covers a small amount of time (perhaps only minutes), and is not representative of an entire day
% Max Tweets/page limited to 100 by Twitter.com

% Regular expression for pulling out dates/times
exp = '((31(?!\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\b|t)t?|Nov)(ember)?)))|((30|29)(?!\ Feb(ruary)?))|(29(?=\ Feb(ruary)?\ (((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8])\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\b|t)t?|Nov|Dec)(ember)?)\ ((1[6-9]|[2-9]\d)\d{2}) (([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9])):(([0-9])|([0-5][0-9]))[^[0-9]]';
urlHost = 'http://search.twitter.com/search.json';

% 1. Love
search{1} = '?q="i+love+you"+OR+"i+love+her"+OR+"i+love+him"+OR+"all+my+love"+OR+"i''m+in+love"+OR+"i+really+love"&rpp=100&result_type=recent';
emotion{1} = 'Love     ';
% 2. Joy
search{2} = '?q="happiest"+OR+"so+happy"+OR+"so+excited"+OR+"i''m+happy"+OR+"woot"+OR+"w00t"&rpp=100&result_type=recent';
emotion{2} = 'Joy      ';
% 3. Surprise
search{3} = '?q="wow"+OR+"O_o"+OR+"can''t+believe"+OR+"wtf"+OR+"unbelievable"&rpp=100&result_type=recent';
emotion{3} = 'Surprise ';
% 4. Anger
search{4} = '?q="i+hate"+OR+"really+angry"+OR+"i+am+mad"+OR+"really+hate"+OR+"so+angry"&rpp=100&result_type=recent';
emotion{4} = 'Anger    ';
% 5. Envy
search{5} = '?q="i+wish+i"+OR+"i''m+envious"+OR+"i''m+jealous"+OR+"i+want+to+be"+OR+"why+can''t+i"+&rpp=100&result_type=recent';
emotion{5} = 'Envy     ';
% 6. Sadness
search{6} = '?q="i''m+so+sad"+OR+"i''m+heartbroken"+OR+"i''m+so+upset"+OR+"i''m+depressed"+OR+"i+can''t+stop+crying"&rpp=100&result_type=recent';
emotion{6} = 'Sadness  ';
% 7. Fear
search{7} = '?q="i''m+so+scared"+OR+"i''m+really+scared"+OR+"i''m+terrified"+OR+"i''m+really+afraid"+OR+"so+scared+i"&rpp=100&result_type=recent';
emotion{7} = 'Fear     ';

disp('Emotion  Tweets/min, MinutesCovered')
% I didn't realize "Trends" are scalars
% for loop=1:length(search)
loop = 3;
    url = [urlHost search{loop}];
    page = urlread(url);
    matches=regexp(page, exp, 'match');
    time1 = datenum(matches{1});

    url = [urlHost search{loop} '&page=15'];
    page = urlread(url);
    matches=regexp(page, exp, 'match');
    time2 = datenum(matches{end});

    seconds = (time1-time2)*24*60*60;
    tweetsPerMinute = (1400+length(matches))/(seconds / 60);

    disp([emotion{loop} num2str(tweetsPerMinute) ', ' num2str(seconds/60)])

% end

updatetrend(tweetsPerMinute);
Tags:

    Add Tags


    0 comments