Skip to content

Instantly share code, notes, and snippets.

@kenjiskywalker
Created January 3, 2014 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenjiskywalker/8232609 to your computer and use it in GitHub Desktop.
Save kenjiskywalker/8232609 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'cinch'
require 'weather_jp'
bot = Cinch::Bot.new do
configure do |c|
c.server = IPADDR
c.port = PORT
c.ssl.use = true
c.password = PASSWORD
c.channels = ["#channel"]
c.nick = 'tenki_kun'
c.realname = 'tenki_kun'
c.user = 'tenki_kun'
end
on :message, /Whats the Weather Like Today?/ do |m|
kanagawa = WeatherJp.get :kanagawa
sleep 2
m.reply "#{kanagawa.today.to_s}"
end
on :message, /Weather forecast for tomorrow?/ do |m|
kanagawa = WeatherJp.get :kanagawa
sleep 2
m.reply "#{kanagawa.tomorrow.to_s}"
end
end
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment