Collecting tweet from twitter using Matlab

Hello! I'm looking for the way to collect tweet from twitter using Matlab as the follows.
- Given the query (i.e. iPad) - Given a period of time (i.e. Jan 2012 - Mar 2012)
Then the program will retrieve tweets contain the term 'iPad' within such period of time and stored in the text file.
Would you please suggest?
Thank you very much.

 Accepted Answer

You can use the Twitter REST API to perform such queries. There is a MATLAB File Exchange submission called twitty which uses that functionality - you can use it like any MATLAB class.

3 Comments

Hello Kaustubha Govind,
Thank you very much for your advise. I have just completed creating my twitter credentials regarding the instruction. I run the command as the follow.
credentials.ConsumerKey = 'XXXXXXXXXXX';
credentials.ConsumerSecret = 'XXXXXXXXXXX';
credentials.AccessToken = 'XXXXXXXXXXXXX';
credentials.AccessTokenSecret = 'XXXXXXXXXXX';
Then I run the command tw = twitty(credentials)
But I got the error message as the follows
??? Error using ==> strfind Inputs must be character arrays.
Error in ==> twitty>twitty.twitty at 149 if strfind(lower(S{1}),'error'), error('The supplied credentials are not valid.'); end
Could you please advise?
Rucci: Sorry, I'm not familiar with that submission, I just found it using a web search. Perhaps you can post your question as a comment on the twitty page, or contact the author directly.
That's ok. Thank you very much. (^___^)

Sign in to comment.

More Answers (1)

Hey could u solve the problem? I am doing a thesis and I want to collect tweets for a specific period? may you help me?

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!