twitty

Interface-class to access the Twitter REST API v1.1.
3.9K Downloads
Updated 12 Jul 2013

View License

twitty is a MATLAB class for interaction with the twitter platform via its REST API v1.1.

Here are some examples of its usage:
tw = twitty(credentials); % create a twitty object and supply user credentials.

For details on credentials, type "help twitty" and refer to the sections about PROPERTIES and OBTAINING TWITTER CREDENTIALS.

After setting valid credentials, a twitty object should be able to access the Twitter platform. 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.sampleStatuses(); % get a continuous stream of a random sample of all public statuses.
4. S = tw.userTimeline('screen_name', 'matlab'); % get recent messages posted by the user 'matlab';
5. S = tw.trendsAvailable(); % get place for which Twitter has trends available.

Conceptually, twitty methods are just wrapper functions around the main function which calls the Twitter API. This API caller function, callTwitterAPI(), does the main job:
creates an HTTPS request, handles the authentication and encoding, sends the request to and parses a response from the Twitter platform. It is not meant to be called directly but should be invoked
from a wrapper function.

The wrapper functions provide an intuitive MATLAB-style interface for accessing the Twitter's API resources. For the complete description of the REST API v1.1, refer to the official
documentation at https://dev.twitter.com/docs/api/1.1.
The API is quite extensive and twitty doesn't cover it all. It includes most of the resources in the following sections: TIMELINES, STREAMING, TWEETS, SEARCH, FRIENDS & FOLLOWERS, USERS, PLACES & GEO, TRENDS, and HELP.

For the summary of the twitty's methods run the 'twitty.API' command.
For information on a particular function, type 'help twitty.<function name>'.

REQUIREMENTS:
optional - the json parser by Joel Feenstra: http://www.mathworks.co.uk/matlabcentral/fileexchange/20565-json-parser

Cite As

Vladimir Bondarenko (2024). twitty (https://www.mathworks.com/matlabcentral/fileexchange/34837-twitty), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.5.0.0

Added auxiliary files: tweetingSummary.m and coastline.mat.

1.4.0.0

Fixed: error in the constructor call twitty(creds), due to the outdated credentials validity check.

1.3.0.0

Updated to the Twitter REST API v1.1.
Added support for the Streaming API.

1.1.0.0

Some documentation updates.
Fixes: strfind(lower(S),'error') is changed to strfind(lower(S{1}),'error') in the constructor function, twitty().

1.0.0.0