From 2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Sun, 6 Apr 2014 15:07:48 +0200 Subject: [PATCH] a new command: kotki --- plugins/commands/kotki.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/commands/kotki.rb diff --git a/plugins/commands/kotki.rb b/plugins/commands/kotki.rb new file mode 100644 index 0000000..32ab613 --- /dev/null +++ b/plugins/commands/kotki.rb @@ -0,0 +1,11 @@ +require 'net/http' +require 'uri' + +Client.register_command("kotki") { |args| + url = URL.parse(Config[:commands][:kotki][:url]) + + req = Net::HTTP::Get.new(url.path) + response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } + + response['location'] +}