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

Close-button

Total Number of Tweets by Matthew Simoneau (matthewsim) on Twitter

This trend is disabled.

Error using updatetrend (line 7)
The input must be a number or vector

This trend is disabled and will not collect data until re-enabled.

  • Created by: Matthew Simoneau
  • Last ran: about 2 years ago.
  • Auto-run in: almost 2 years.
  • Created on: 23 Jan 2012
  • Liked: 1 time

165

data points

Disabled

Description:

Count the total number of tweets made by Matthew Simoneau on Twitter.

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

Time Recorded (time1269) Data (data1269)
15 Jul 2012 06:09:55 NaN
14 Jul 2012 06:09:53 NaN
13 Jul 2012 06:09:42 NaN
12 Jul 2012 06:09:55 NaN
11 Jul 2012 06:09:27 NaN
% Initialize the HTML parser, which happens to ship with MATLAB.
htmlConfiguration = org.cyberneko.html.HTMLConfiguration();
parser = org.apache.xerces.parsers.DOMParser(htmlConfiguration);

% Keep trying until we get an answer.
tweets = [];
for tries = 1:10
    % Dowload and parse the page.
    parser.parse('http://twitter.com/matthewsim');
    
    % Scrape the number out of the parsed page.
    spans = parser.getDocument.getElementsByTagName('SPAN');
    for iSpans = 1:spans.getLength()
        span = spans.item(iSpans-1);
        id = char(span.getAttribute('id'));
        if strcmp(id,'update_count')
            tweets = str2double(char(span.getTextContent()));
        end
    end
    
    % How did we do?
    if isempty(tweets)
        % Probably the page didn't download correctly. Wait and try again.
        pause(1)
    else
        % We're done!
        break
    end
end

% Return the result.
updatetrend(tweets);
Tags:

Add Tags


0 comments