Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A library to connect and stream data from the GNIP streaming API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .pryrc
Octocat-spinner-32 .ruby-gemset
Octocat-spinner-32 .ruby-version
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 gnip-stream.gemspec
README.md

gnip-stream

gnip-stream is a ruby library to connect and stream data from GNIP. It utilizes EventMachine and threads under the hood to provide a true streaming experience without you having to worry about writing non blocking code.

Installation

Installing gnip-stream is easy. Simply run gem install gnip-stream or add the following line to your Gemfile:

gem 'gnip-stream', :git => "https://github.com/eriwen/gnip-stream"

Simple Usage

require 'gnip-stream'

### To connect to the special twitter powertrack api
twitter_stream = GnipStream::PowertrackClient.new("http://yourstreamingurl.gnip.com", "someuser", "password")
twitter_stream.consume do |message|
  #process the message however you want
  puts message
end

### To Connect to the Facebook API
facebook_stream = GnipStream::FacebookClient.new("http://yourstreamingurl.gnip.com", "someuser", "password")
facebook_stream.consume do |message|
  puts message
end

Compatibility

This gem is tested to be compatible with:

  • MRI 1.8.7, 1.9.x, 2.0.0
  • JRuby 1.7.0
  • Rubinius 2.0.0dev

Contributing

Build Status Code Climate Coverage Status

When submitting pull requests, please do the following to make it easier to incorporate your changes:

  • Include unit and/or functional specs that validate changes you're making.
  • Rebase your changes onto the HEAD of my fork if you can do so cleanly.
  • If submitting additional functionality, provide an example of how to use it.
  • Please keep code style consistent with surrounding code.

Testing

You can run all tests by simply running bundle exec rake test from your favorite shell.

Contributors

License

MIT. See LICENSE file for more details.

Special thanks to Sharethrough

Something went wrong with that request. Please try again.