summaryrefslogtreecommitdiffstats
path: root/plugins/commands/bonjour.rb
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2015-08-11 23:16:43 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2015-08-11 23:16:43 +0200
commite1ad4ad3d59a613d33271cd6b8d33bedaced847f (patch)
tree111ab420c885f88e74568f6c3772009e685af2b5 /plugins/commands/bonjour.rb
parentd68fc1a8dfd5c31f7346925d3f0ebf2aa7e1635f (diff)
downloadrepost-e1ad4ad3d59a613d33271cd6b8d33bedaced847f.tar.gz
repost-e1ad4ad3d59a613d33271cd6b8d33bedaced847f.tar.bz2
repost-e1ad4ad3d59a613d33271cd6b8d33bedaced847f.tar.xz
repost-e1ad4ad3d59a613d33271cd6b8d33bedaced847f.zip
Add images from bonjourmadame.fr
Diffstat (limited to 'plugins/commands/bonjour.rb')
-rw-r--r--plugins/commands/bonjour.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/commands/bonjour.rb b/plugins/commands/bonjour.rb
new file mode 100644
index 0000000..ac15e8f
--- /dev/null
+++ b/plugins/commands/bonjour.rb
@@ -0,0 +1,7 @@
+require 'net/http'
+require 'nokogiri'
+
+Client.register_command("bonjour") { |args|
+ link = Config.lookup("commands::bonjour::url") + String(rand(1..2370))
+ Config.lookup("commands::bonjour::message") + Nokogiri::HTML(Net::HTTP.get(URI(link))).xpath('//div[@class="photo post"]/img/@src').inner_text
+}