Skip to content
Streaming and REST Twitter Clients supporting API v1.1 for openFrameworks.
C++ Other
  1. C++ 99.1%
  2. Other 0.9%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
example_basic_rest_search
example_basic_rest_search_download_image
example_basic_streaming_filter
libs/ofxTwitter
scripts
src
.appveyor.yml
.gitignore
.gitmodules
.travis.yml
LICENSE.md
README.md
addon_config.mk

README.md

ofxTwitter

Description

Streaming and REST Twitter Clients for openFrameworks

Features

  • Twitter Streaming API client.
  • Twitter Search API client.
  • Easily extensible.
  • Many API features implemented (e.g. Search, Tweet, Media Upload).

Getting Started

To get started, generate the example project files using the openFrameworks Project Generator.

Documentation

API documentation can be found here.

Twitter Credentials

In order to use the Twitter API with ofxTwitter, you will need a Twitter developer account and a registered Twitter application in order to generate the required credential information. To do this:

  1. Create an account at twitter.com if do not already have one.
  2. Create a Twitter application on apps.twitter.com.
  3. Once you have created an application, choose the "Keys & Access Tokens" tab and make note of the following credential items:
  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

These credentials can be used with ofxTwitter programmatically or by loading a JSON file. A template JSON credentials file is provided with each example in ofxTwitter: bin/data/credentials.json. If you are working with multiple OF apps using the same credential info, you can just copy and reuse the same credentials.json file.

Note that the credentials are loaded with this code, usually in the ofApp::setup() method:

  client.setCredentialsFromFile("credentials.json");

Alternatively you can load credentials programmatically with the following:

    ofxHTTP::OAuth10Credentials credentials("YOUR_CONSUMER_KEY_HERE",
                                            "YOUR_CONSUMER_SECRET_HERE",
                                            "YOUR_ACCESS_TOKEN_HERE",
                                            "YOUR_ACCESS_TOKEN_SECRET_HERE");
    client.setCredentials(credentials)

Creating a Twitter Application

To create an application with ofxTwitter you need credentials (see above) and (optionally) you need an SSL certificate bundle (See ofxSSLManager for more info) in your bin/data folder. You will likely need to include the following files:

  • credentials.json: your Twitter app's consumer & access token information.
  • ssl/cacert.pem: a collection of trusted root certification authorities, needed for the SSL communication for the Twitter API.

Keep Your Credentials Secret

Be careful not to upload your credentials.json file to a public Github repository. If you do, don't worry -- you can easily log on to apps.twitter.com and revoke your compromised credentials and generate new ones.

Compatibility

Branches

The stable branch of this repository is meant to be compatible with the openFrameworks stable branch, which corresponds to the latest official openFrameworks release.

The master branch of this repository is meant to be compatible with the openFrameworks master branch.

Some past openFrameworks releases are supported via releases, but only the stable branch and the master branch are actively supported.

Requirements

Versioning

This project uses Semantic Versioning, although strict adherence will only come into effect at version 1.0.0.

Licensing

See LICENSE.md.

Contributing

Pull Requests are always welcome, so if you make any improvements please feel free to float them back upstream :)

  1. Fork this repository.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.
You can’t perform that action at this time.