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 collapse
- 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
-
.method_missing(method, *args, &block) ⇒ Object
Delegate to TweetStream::Client.
-
.new(options = {}) ⇒ TweetStream::Client
Alias for TweetStream::Client.new.
-
.respond_to?(method, include_private = false) ⇒ Boolean
Delegate to TweetStream::Client.
Methods included from Configuration
configure, extended, oauth_options, options, reset
Class Method Details
.method_missing(method, *args, &block) ⇒ Object
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 |
.new(options = {}) ⇒ TweetStream::Client
Alias for TweetStream::Client.new
21 22 23 |
# File 'lib/tweetstream.rb', line 21 def new( = {}) TweetStream::Client.new() end |
.respond_to?(method, include_private = false) ⇒ Boolean
Delegate to TweetStream::Client
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 |