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'
hotel_id = "2682464"
sample = Daodao::Rank.new(hotel_id)
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 hotel_id 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
- The speed is still a problem
Contributing
- Fork it ( https://github.com/[my-github-username]/daodao/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request