Bias on the ABC

clear all

runTime = 64;
count = 50;

tw = twitty();

for i = 1:runTime

if i == 1
S{1,i} = tw.userTimeline(‘screen_name’, ‘abcgrandstand’, ‘count’, count);
else
lastTweetId = S{1,i-1}{1,1}{1,count}.id_str;
S{1,i} = tw.userTimeline(‘screen_name’, ‘abcgrandstand’, ‘count’, count, ‘max_id’, lastTweetId); %S{1,CollectionRun}{1,1}{1,PlaceInThisRun}

end

runLoop = i

end

%%
newCount = count-1;
for l = 1:runTime
for k = 1:newCount;

G{1,l}{1,1}{1,k} = S{1,l}{1,1}{1,k}

end
end
%%

for l = 1:runTime
for k = 1:newCount;

B{1,(((l-1)*newCount)+k)} = G{1,l}{1,1}{1,k}.text;

end
end

%%

for c = 1:size(B,2)
T{c} = lower(B{c});

AFLtemp{c} = strfind(T{c}, ‘afl’);
AFLtemp2 = cell2mat(AFLtemp);
mentionsAFL = size(AFLtemp2,2);

NRLtemp{c} = strfind(T{c}, ‘nrl’);
NRLtemp2 = cell2mat(NRLtemp);
mentionsNRL = size(NRLtemp2,2);

TENNIStemp{c} = strfind(T{c}, ‘tennis’);
TENNIStemp2 = cell2mat(TENNIStemp);
mentionsTENNIS = size(TENNIStemp2,2);

WORLDCUPtemp{c} = strfind(T{c}, ‘worldcup’);
WORLDCUPtemp2 = cell2mat(WORLDCUPtemp);
mentionsWORLDCUP = size(WORLDCUPtemp2,2);

CYCLINGtemp{c} = strfind(T{c}, ‘cycling’);
CYCLINGtemp2 = cell2mat(CYCLINGtemp);
mentionsCYCLING = size(CYCLINGtemp2,2);

RUGBYtemp{c} = strfind(T{c}, ‘rugby’);
RUGBYtemp2 = cell2mat(RUGBYtemp);
mentionsRUGBY = size(RUGBYtemp2,2);
end

%%
mentions = horzcat(mentionsAFL, (mentionsNRL+mentionsRUGBY))
figure
bar(mentions)
axis square
set(gca, ‘XTickLabel’,{‘AFL’, ‘All rugby’})
xlabel(‘Mentions in tweets by @ABCgrandstand between June 7 and July 18’)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s