RubyGems.org

baidu_web

0.0.1

# Baidu_web Baidu_web是一个基于百度的元搜索引擎,输入关键字,返还百度搜索结果和相关的关键词; 在线Demo: http://www.inruby.com/search ## 用法 gem 'baidu_web' ## 调用 # http://www.baidu.com/s?wd=inruby&pn=100&rn=50 BaiduWeb.search("inruby", :per_page => 50, :page_index => 2) ## 返还结果 result = BaiduWeb.search('key words') result[:record_arr].each do |record| puts record.title puts record.url puts record.summary puts record.updated_date puts record.item_index puts record.cached_url end result[:ext_key_arr].each do |ext_key| puts ext_key.title puts ext_key.url end ## 在irb中测试: $:.unshift(File.dirname(__FILE__)) require 'baidu_web' require 'cgi' result = BaiduWeb.search(CGI.escape("游戏"), :per_page => 10, :page_index => 1)

installgem install baidu_web -v 0.0.1
Authors

krongk

4,733 total downloads 962 for this version
Owners

18e31530318cab06573028bf5a52cb9a

Gemfile
gem 'baidu_web', '~> 0.0.1'
Versions
  1. 0.2.5 November 29, 2012 (8 KB)
  2. 0.2.4 November 29, 2012 (8 KB)
  3. 0.2.3 November 29, 2012 (8 KB)
  4. 0.2.1 November 29, 2012 (8 KB)
  5. 0.0.1 November 29, 2012 (8.5 KB)