From 694de5fdb720f9f9a06424f4639540f618b6e9ce Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Tue, 25 Mar 2014 07:44:14 +0100 Subject: [PATCH] Add an sjp plugin. --- plugins/commands/sjp.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/commands/sjp.rb diff --git a/plugins/commands/sjp.rb b/plugins/commands/sjp.rb new file mode 100644 index 0000000..a4dd508 --- /dev/null +++ b/plugins/commands/sjp.rb @@ -0,0 +1,7 @@ +require 'net/http' +require 'nokogiri' + +Client.register_command("sjp") { |args| + doc = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:sjp][:url] + args[0]))) + doc.xpath('//ul[@id="listahasel"]/li/div/div').inner_text +}