Skip to content

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

License

Notifications You must be signed in to change notification settings

eriwen/gnip-stream

 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%