Overview
A simple Rails application that uses the Gnip Historical PowerTrack API to give you complete and comprehensive access to every publicly available Tweet, ever.
This sample application demonstrates how to effectively interact with the API and manage your historical jobs.
Here's a short video showing how to get Twitter data about the 2014 World Cup matches:
Features
- Create, estimate, accept and download Historical jobs
- Detailed job progress
- Filter jobs based on ID, Title, Date or Status
- Supports IE10+, FF, Chrome, Opera 12+, Safari 5+
- NOTE: If your expected dataset is large (over 1GB), we recommend you use a more efficient tool to parallelize file downloads
Requirements
- A Gnip Account with a Historical PowerTrack Subscription
- Ruby 2.0.x.
- Ruby on Rails 4.0.x.
- You may need Python on your
PATH
to install some dependencies on Windows
Setup
Open a terminal window and execute the following commands:
git clone git://github.com/twitterdev/historical-api-rails-demo.git
cd historical-api-rails-demo
Ensure the following environment variables are set:
- GNIP_ACCOUNT = Your Gnip account.
- GNIP_USERNAME = Your Gnip username.
- GNIP_PASSWORD = Your Gnip password.
Usage
To run, execute bundle install
and then rails s
.
Testing
To test, do the following:
- Ruby Specs:
rake spec
- JavaScript Specs:
rake spec:javascript
- Both:
rake test
NOTE: guard
will automatically run RSpec, and CoffeeScript (sorry, no auto-jasmine yet).
Contributions
Read CONTRIBUTING for details.