A library to connect and stream data from the GNIP streaming API
Ruby
Clone or download
Pull request Compare This branch is 11 commits ahead, 8 commits behind rweald:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.pryrc
.ruby-gemset
.ruby-version
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
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