2014-04-06 13:07:48 +00:00
|
|
|
require 'net/http'
|
|
|
|
require 'uri'
|
|
|
|
|
|
|
|
Client.register_command("kotki") { |args|
|
2014-04-06 13:11:09 +00:00
|
|
|
url = URI.parse(Config[:commands][:kotki][:url])
|
2014-04-06 13:07:48 +00:00
|
|
|
|
|
|
|
req = Net::HTTP::Get.new(url.path)
|
|
|
|
response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
|
|
|
|
|
|
|
response['location']
|
|
|
|
}
|