Daodao

Daodao is a Ruby gem that crawls the ota's ranking and the rooms details in www.daodao.com

Installation

Add this line to your application's Gemfile:

gem 'daodao'

And then execute:

$ bundle

Or install it yourself as:

$ gem install daodao

Getting started

 $ touch test.rb
 $ vi test.rb

Add some codes like the following

require 'daodao' 
  uri = "/Hotel_Review-g298555-d2682464-Reviews-Four_Seasons_Hotel_Guangzhou-Guangzhou_Guangdong.html"
  sample = Daodao::Rank.new(uri)
  puts 'The rooms details are as follow :'
  puts sample.rooms_details

This will crawl the rooms details of the target hotel for you.

Note: You can pass other uri to initialize representing the hotel page.

Get ota's ranking

require 'daodao'

  ranking = sample.rank
  puts "The ota's ranking are as follow :"
  puts ranking

Bug

  1. The speed is still a problem

Contributing

  1. Fork it ( https://github.com/[my-github-username]/daodao/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request