14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/cerberus/publisher/twitter.rb', line 14
def self.publish(state, manager, options)
begin
require 'twitter'
= options[:publisher, :twitter]
raise "There is no login info for Twitter publisher" unless [:login] and [:password]
subject,body = Cerberus::Publisher::Base.formatted_message(state, manager, options)
client = Twitter::Client.new( :login => [:login], :password => [:password] )
status = client.status( :post, subject )
rescue Gem::LoadError
puts "Twitter publisher requires that you install the 'twitter4r' gem first."
end
end
|