Module: TweetStream

Extended by:
Configuration
Defined in:
lib/tweetstream/daemon.rb,
lib/tweetstream.rb,
lib/tweetstream/client.rb,
lib/tweetstream/version.rb,
lib/tweetstream/arguments.rb,
lib/tweetstream/configuration.rb,
lib/tweetstream/site_stream_client.rb

Overview

A daemonized TweetStream client that will allow you to create backgroundable scripts for application specific processes. For instance, if you create a script called tracker.rb and fill it with this:

require 'rubygems'
require 'tweetstream'

TweetStream.configure do |config|
  config.consumer_key = 'abcdefghijklmnopqrstuvwxyz'
  config.consumer_secret = '0123456789'
  config.oauth_token = 'abcdefghijklmnopqrstuvwxyz'
  config.oauth_token_secret = '0123456789'
  config.auth_method = :oauth
end

TweetStream::Daemon.new('tracker').track('intridea') do |status|
  # do something here
end

And then you call this from the shell:

ruby tracker.rb start

A daemon process will spawn that will automatically run the code in the passed block whenever a new tweet matching your search term ('intridea' in this case) is posted.

Defined Under Namespace

Modules: Configuration Classes: Arguments, Client, Daemon, ReconnectError, SiteStreamClient

Constant Summary

VERSION =
'2.6.1'

Constants included from Configuration

Configuration::DEFAULT_AUTH_METHOD, Configuration::DEFAULT_CONSUMER_KEY, Configuration::DEFAULT_CONSUMER_SECRET, Configuration::DEFAULT_OAUTH_TOKEN, Configuration::DEFAULT_OAUTH_TOKEN_SECRET, Configuration::DEFAULT_PASSWORD, Configuration::DEFAULT_PROXY, Configuration::DEFAULT_USERNAME, Configuration::DEFAULT_USER_AGENT, Configuration::OAUTH_OPTIONS_KEYS, Configuration::VALID_FORMATS, Configuration::VALID_OPTIONS_KEYS

Class Method Summary (collapse)

Methods included from Configuration

configure, extended, oauth_options, options, reset

Class Method Details

+ (Object) method_missing(method, *args, &block)

Delegate to TweetStream::Client



26
27
28
29
# File 'lib/tweetstream.rb', line 26

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

+ (TweetStream::Client) new(options = {})

Alias for TweetStream::Client.new

Returns:



21
22
23
# File 'lib/tweetstream.rb', line 21

def new(options = {})
  TweetStream::Client.new(options)
end

+ (Boolean) respond_to?(method, include_private = false)

Delegate to TweetStream::Client

Returns:

  • (Boolean)


32
33
34
# File 'lib/tweetstream.rb', line 32

def respond_to?(method, include_private = false)
  new.respond_to?(method, include_private) || super(method, include_private)
end