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
Follow me (@stuartmcgarrity) if you want to be notified via Twitter when I post.
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
1 CommentsOldest to Newest
Hi is it possible for you to teach me with a sample code of how to stream 1000 tweets about ‘nfl’ using the Twitty streamer and saving the data into a mat file ? I’ve got the correct credentials but can’t seem to proceed with streaming and much less saving the tweets.
Thank you for you help