Since you are new, let us show you how Trendy works.

Close-button

Sadness Tweets/min

This trend is broken.

Emotion  Tweets/min, MinutesCovered
Index exceeds matrix dimensions.
  • Created by: Sam Mirsky
  • Last ran: over 1 year ago.
  • Auto-run in: over 1 year.
  • Created on: 20 Jan 2012

439

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 439) Show All Data

Time Recorded (time1237) Data (data1237)
05 Jun 2013 06:00:23 NaN
04 Jun 2013 06:00:17 [11.6279069747294]
03 Jun 2013 06:00:16 [11.1662531077237]
02 Jun 2013 06:00:16 [10.3436386633564]
01 Jun 2013 06:00:19 [9.90643918733913]
% 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 = 6;
    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