summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2014-04-27 14:08:19 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2014-04-27 14:08:19 +0200
commit8987a71513cad7edb3fe268a0c1aee748cb83507 (patch)
tree46eacc7c0b45b383dadbe36c990a5727277ebed5
parent5739f37ced74b67a1d4b45d91b2d62faf033c96f (diff)
downloadrepost-8987a71513cad7edb3fe268a0c1aee748cb83507.tar.gz
repost-8987a71513cad7edb3fe268a0c1aee748cb83507.tar.bz2
repost-8987a71513cad7edb3fe268a0c1aee748cb83507.tar.xz
repost-8987a71513cad7edb3fe268a0c1aee748cb83507.zip
Never return empty tits again.
-rw-r--r--plugins/commands/cycki.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/commands/cycki.rb b/plugins/commands/cycki.rb
index afb07a0..77fd612 100644
--- a/plugins/commands/cycki.rb
+++ b/plugins/commands/cycki.rb
@@ -2,5 +2,9 @@ require 'net/http'
require 'nokogiri'
Client.register_command("cycki") { |args|
- Config[:commands][:cycki][:message] + Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:cycki][:url]))).xpath('//img/@src').inner_text.gsub("_preview", "")
+ link = ""
+ begin
+ link = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:cycki][:url]))).xpath('//img/@src').inner_text.gsub("_preview", "")
+ end while link !~ /http/
+ Config[:commands][:cycki][:message] + link
}