/
em-twitter.rb
40 lines (35 loc) · 1.05 KB
/
em-twitter.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'em-twitter/client'
require 'em-twitter/version'
require 'logger'
module EventMachine
module Twitter
DEFAULT_CONNECTION_OPTIONS = {
:host => 'stream.twitter.com',
:port => 443,
:method => 'POST',
:content_type => "application/x-www-form-urlencoded",
:path => '/',
:params => {},
:headers => {},
:user_agent => "EM::Twitter Ruby Gem #{EM::Twitter::VERSION}",
:proxy => nil,
:ssl => {},
:timeout => 0,
:oauth => {},
:basic => {},
:encoding => nil,
:auto_reconnect => true
}
DEFAULT_REQUEST_PARAMETERS = {
:stall_warnings => 'true'
}
class ReconnectLimitError < StandardError; end
class ConfigurationError < StandardError; end
def self.logger
@logger ||= Logger.new(STDOUT)
end
def self.logger=(new_logger)
@logger = new_logger
end
end
end