Skip to content

Commit

Permalink
support for bang-twitter, aka CoTweet Lite
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Wilkinson committed Aug 13, 2009
1 parent 68c968d commit 1fa3f24
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fatbot.rb
Expand Up @@ -13,6 +13,7 @@
require 'open-uri' # for !meme, !swineflu
require 'mechanize' # for !swineflu
#gem 'jnunemaker-twitter', :lib => 'twitter' for !twitter
require 'twitter'
puts %w{twitter_search flickraw}.collect{|ld|ld+': '+require(ld).to_s}#.join(", ")

# require 'sequel'
Expand Down Expand Up @@ -67,9 +68,13 @@ def ops?(nick)

# post to a shared twitter account
on :channel, /^\!twitter (.*)/i do
cred = YAML.load('twitter.yml')
# TODO do some stuff with twitter gem
msg channel, "*** posting announcement by #{nick} to http://twitter.com/fffffat ..."
cred = YAML.load(File.open('twitter.yml'))

httpauth = Twitter::HTTPAuth.new(cred['username'], cred['password'])
base = Twitter::Base.new(httpauth)
base.update(match[0])

msg channel, "*** affirmative #{nick}, posted to #{cred['username'].inspect}"
end


Expand Down

0 comments on commit 1fa3f24

Please sign in to comment.