Modify the xpath

This commit is contained in:
Robert Gerus 2015-08-11 23:26:32 +02:00
parent e1ad4ad3d5
commit 2f0518a7f0

View file

@ -3,5 +3,5 @@ require 'nokogiri'
Client.register_command("bonjour") { |args| Client.register_command("bonjour") { |args|
link = Config.lookup("commands::bonjour::url") + String(rand(1..2370)) 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 Config.lookup("commands::bonjour::message") + Nokogiri::HTML(Net::HTTP.get(URI(link))).xpath('//div[@class="photo post"]//img/@src').inner_text
} }