Sha256: b7c08483d6f9aa6c57c707db26a021a1a97c248350c085f72216d9d157ea0068

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

module Silvermoon
  module Notifier
    class Twitter < Base

      def configure
        ::Twitter.configure do |c|
          c.consumer_key       = config['consumer_key']
          c.consumer_secret    = config['consumer_secret']
          c.oauth_token        = config['oauth_token']
          c.oauth_token_secret = config['oauth_token_secret']
        end
      end

      def notify(title, content, url, extras = {})
        Rails.logger.info("Notifying Twitter: #{title}, #{content}, #{url}")
        twitter.update(title[0..140])
      end

      def twitter
        @twitter ||= begin
                       configure
                       ::Twitter::Client.new
                     end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
silvermoon-0.1 lib/silvermoon/notifier/twitter.rb