Sha256: a9147ef648b9ffa85e95351eae2dd8405106909c77289583e15ec980ddb23634

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

module StreamBot
  # wrapper class for dealing with twitters native retweet api
  class Retweet
    # intitialize method aka constructor
    def initialize(params)
      @handler = StreamBot::OAuth.new(params['oauth'])
    end

    # retweets the status with given id
    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
streambot-1.0.1 lib/streambot/retweet.rb