Class: TweetDump
- Inherits:
-
Object
- Object
- TweetDump
- Defined in:
- lib/tweetdump.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#logfile ⇒ Object
Returns the value of attribute logfile.
-
#password ⇒ Object
Returns the value of attribute password.
-
#screen_name ⇒ Object
Returns the value of attribute screen_name.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TweetDump
constructor
A new instance of TweetDump.
- #run! ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ TweetDump
Returns a new instance of TweetDump.
12 13 14 15 16 17 18 19 |
# File 'lib/tweetdump.rb', line 12 def initialize(opts={}) @screen_name = opts[:screen_name] @password = opts[:password] @limit = opts[:limit] @logfile = opts[:logfile] || '/dev/null' @api = opts[:api] || 'streaming' @keyword = opts[:keyword] end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def api @api end |
#keyword ⇒ Object
Returns the value of attribute keyword.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def keyword @keyword end |
#limit ⇒ Object
Returns the value of attribute limit.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def limit @limit end |
#logfile ⇒ Object
Returns the value of attribute logfile.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def logfile @logfile end |
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def password @password end |
#screen_name ⇒ Object
Returns the value of attribute screen_name.
11 12 13 |
# File 'lib/tweetdump.rb', line 11 def screen_name @screen_name end |
Instance Method Details
#run! ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tweetdump.rb', line 21 def run! @count = 1 @page = 0 if @api == 'streaming' fetch_streaming elsif @api == 'search' fetch_search else logger.error "API is invalid or unsupported" raise "Unsupported API" end end |