public
Rubygem
Description: Find some previously used domain names and check availability
Homepage:
Clone URL: git://github.com/remi/domain-finder.git
google bugfixes ... supports google search results with no cache and/or no 
snippet
remi (author)
Sat Jun 14 15:40:16 -0700 2008
commit  84838f2fc9e069261e28d16586bb964b26c7041d
tree    0e7b153bcc0ae0353f91952490c3ae671efd9252
parent  a6e706532cb74e08d94662c2d35ef96f8b1a4256
...
36
37
38
39
40
41
42
43
44
 
 
 
 
 
 
 
 
 
 
 
 
45
46
47
...
36
37
38
 
 
 
 
 
 
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
0
@@ -36,12 +36,18 @@ class Google
0
     def initialize result
0
       @title   = ( result / 'h2.r' ).inner_text
0
       @url     = ( result / 'h2.r a' )[0]['href']
0
-      @cached  = ( result / 'div.std nobr a' )[0]['href'] if ( result / 'div.std nobr a' )[0].inner_text == 'Cached'
0
-      @snippet = ""
0
-      ( result / 'div.std' )[0].children.each do |this| 
0
-        break if this.to_s == '<br />'
0
-        @snippet << this.inner_text
0
-      end 
0
+
0
+      cached_element = ( result / 'div.std nobr a' )[0]
0
+      @cached  = cached_element['href'] if cached_element and cached_element.inner_text == 'Cached'
0
+
0
+      snippet_element = ( result / 'div.std' )[0]
0
+      if snippet_element
0
+        @snippet = ""
0
+        snippet_element.children.each do |this| 
0
+          break if this.to_s == '<br />'
0
+          @snippet << this.inner_text
0
+        end 
0
+      end
0
     end
0
   end
0
 end

Comments