summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2014-04-06 15:07:48 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2014-04-06 15:07:48 +0200
commit2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5 (patch)
tree20b3a6091aed9ef53e7e122cd66775ffe8b438f6
parent951950a7b2eb00ecf11045e6a58b5e45c7e43698 (diff)
downloadrepost-2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5.tar.gz
repost-2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5.tar.bz2
repost-2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5.tar.xz
repost-2076d8fe354f672dfddf5bfe2ebae9fa9b1926e5.zip
a new command: kotki
-rw-r--r--plugins/commands/kotki.rb11
1 files changed, 11 insertions, 0 deletions
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']
+}