bio_img_videos

Stuart’s MATLAB Videos

Watch and Learn

Setting-Up and Running Toshi’s Blog Post Code to Analyze Tweets About Fake News

My colleague Toshi made a very interesting post on Loren’s blog recently about analyzing Twitter. Someone asked if he could give some instructions on how to set up and run his code as it is a bit involved. I thought I could help with a code-along style video going over the steps which include:

  • Downloading the blog post code and data
  • Downloading twitty from the File Exchange
  • Registering an application on Twitter (apps.twitter.com) to get authentication tokens for API Access
  • Configuring of twitty with the acquired authentication tokens
  • Downloading the AFINN data set text file

Video Player is loading.
Current Time 0:00
Duration 27:36
Loaded: 0.60%
Stream Type LIVE
Remaining Time 27:36
 
1x
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

    Play the video in full screen mode for a better viewing experience.

    Here is that string truncation utility function I used.

    function strOut = truncStr(strIn,max,addDots)
    % Truncate a char array strIn to a max number of characters and optionally add ellipses
    
    if strlength(strIn) > max    
        strOut = extractBefore(strIn,max);
        if addDots
            strOut=strOut + '...';
        end
    else
        strOut=strIn;
    end
    
    % Set back to char
    if ischar(strIn)
        strOut=char(strOut);
    end
    
    
    |
    • print

    コメント

    コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。

    Loading...