The web scraper service we built provides listings of tour packages from Lonelyplanet based on a specified country. We have bundled this service into the lonely_planet_tours gem for you to use.
Note that we respect Lonelyplanet's 'robots.txt' file.
Usage
Install at the command line:
$ gem install lonely_planet_tours
or include it in your 'Gemfile' as:
gem 'lonely_planet_tours'
Try it yourself!
Run it from the command line as:
$ lonely_planet_tours country_name
or include it in your code:
Initialize class
require 'taiwan_tours'
require 'lonely_planet_tours'
country = LonelyPlanetScrape::LonelyPlanetTours.new(country)
Use:
Get tours elements
tours = country.tours
OR
Get tours with specific total elements number. total_elements is optional
```ruby
tours = country.tours(total_elements)
Want to make improvements?
- Fork it ( https://github.com/ZhongMeiZhou/scraper_project )
- 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