spiderable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spiderable/railtie/middleware.rb +6 -2
- data/lib/spiderable/version.rb +1 -1
- metadata +1 -1
@@ -30,9 +30,13 @@ module Spiderable
|
|
30
30
|
|
31
31
|
if is_bot
|
32
32
|
url = Crawler.urlFromRack(environment)
|
33
|
-
html = Connect.get_url_contents(url)
|
33
|
+
html = Connect.get_url_contents(url) rescue "FAIL\n"
|
34
34
|
|
35
|
-
|
35
|
+
if html == "FAIL\n"
|
36
|
+
@application.call(environment)
|
37
|
+
else
|
38
|
+
[200, {"Content-Type" => "text/html; charset=utf-8"}, [html]]
|
39
|
+
end
|
36
40
|
else
|
37
41
|
@application.call(environment)
|
38
42
|
end
|
data/lib/spiderable/version.rb
CHANGED