Class: StreamBot::Retweet

Inherits:
Object
  • Object
show all
Defined in:
lib/streambot/retweet.rb

Overview

wrapper class for dealing with twitters native retweet api

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Retweet

intitialize method aka constructor



5
6
7
# File 'lib/streambot/retweet.rb', line 5

def initialize(params)
  @handler = StreamBot::OAuth.new(params['oauth'])
end

Instance Method Details

#retweet(id) ⇒ Object

retweets the status with given id



10
11
12
13
14
15
16
17
# File 'lib/streambot/retweet.rb', line 10

def retweet(id)
  # one thread per retweet, 
  # cause it's much, much faster
  Thread.new do 
    LOG.info "retweet status ##{id}"
    @handler.post("/statuses/retweet/#{id}.json", nil)
  end
end