twitty is a MATLAB class for interaction with the twitter platform via its REST API.
Here are some examples of its usage:
tw = twitty(credentials); % create a twitty object and supply user credentials.
The credentials argument is a structure with the user account's credentials.
The fields are: .ConsumerKey, .ConsumerSecret, .AccessToken, .AccessTokenSecret. E.g.,
credentials.ConsumerKey = 'WuhMKJJXx0TzEtu435OXVA'
credentials.ConsumerSecret = '5ezt6zOG6dDWLZNzxUHsKJtUs52kmMtDqzV7nEjnhU'
credentials.AccessToken = '188321184-7iVtMvx3JVhwfdvJf5J2NKiuQzTz47UnQsFJnWlG'
credentials.AccessTokenSecret = 'idev6Hmq68EsVIQb3pP8nSeN9Rt629BJ4yPKlqlwZk'.
For details on OBTAINING TWITTER CREDENTIALS, type "help twitty" and read the corresponding section.
After setting the credentials, you should be able to access your twitter account from MATLAB. E.g.:
1. S = tw.search('matlab'); % search twitter.com for messages including the word 'matlab'.
2. S = tw.updateStatus('Hello, Twitter!'); % or twit something cooler.
3. S = tw.publicTimeline(); % get 20 recent public messages.
4. S = tw.userTimeline('screen_name', 'matlab'); % get recent messages posted by the user 'matlab';
5. S = tw.trendsDaily(datestr(now-1,'yyyy-mm-dd')); % get yesterday's trends.
Conceptually, twitty is just a collection of wrapper functions around the main function that calls the twitter API.
The wrapper functions provide an intuitive MATLAB-style interface for accessing the twitter's API resources. The API is quite extensive and twitty doesn't cover it all. It includes most of the resources in the following sections: TIMELINE, TWEETS, SEARCH, FRIENDS & FOLLOWERS, USERS, ACCOUNTS, PLACES & GEO, and HELP.
For the complete summary of the twitty's interface functions run 'twitty.API'.
For information on a particular function, type 'help twitty.<function name>'.
For the help on twitty, type 'help twitty'.
REQUIREMENTS:
optional - the json parser by Joel Feenstra: http://www.mathworks.co.uk/matlabcentral/fileexchange/20565-json-parser
|