Method: Query::Result::SogouMobile#seo_ranks

Defined in:
lib/query/result/sogou_mobile.rb

#seo_ranksObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/query/result/sogou_mobile.rb', line 22

def seo_ranks
	@seo_rank ||= @page.search("//ul[@class='searchresult']/li/a").map.with_index do |a,index|
		href = URI.decode(CGI.parse(URI(URI.encode(a['href'])).query)['url'].first)
		{
			:rank => index + 1,
			:text => a.search('h3').text,
			:href => href,
			:host => URI(href).host
		}
	end
end