class Fluent::Plugin::TwitterOutput
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_twitter.rb, line 19 def initialize super end
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_twitter.rb, line 23 def configure(conf) super @twitter = Twitter::REST::Client.new do |config| config.consumer_key = @consumer_key config.consumer_secret = @consumer_secret config.access_token = @access_token config.access_token_secret = @access_token_secret config.proxy = @proxy.to_h if @proxy end end
process(tag, es)
click to toggle source
# File lib/fluent/plugin/out_twitter.rb, line 35 def process(tag, es) es.each do |_time, record| tweet(record['message']) end end
tweet(message)
click to toggle source
# File lib/fluent/plugin/out_twitter.rb, line 41 def tweet(message) begin @twitter.update(message) rescue Twitter::Error => e log.error("Twitter Error: #{e.message}") end end