Giter Club home page Giter Club logo

lhv_crawl_dog_breeds's Introduction

Crawl Dog Breeds Data

1. Install RVM and Ruby Gems

1.1. Install RVM and Ruby 2.7.1:

$ sudo apt install curl
$ command curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg --import -
$ \curl -L https://get.rvm.io | sudo bash -s stable --ruby=2.7.1

Open ~/.bashrc, then add this into the end of the file:

# Load RVM if it is installed
source /usr/local/rvm/scripts/rvm

1.2. Install dependency

$ sudo bash -lc 'gem install bundler'
$ sudo bash -lc 'bundler install'

2. Business requirement

Create a Ruby script that will:

  • Expect an input parameter containing an array of dog breeds.
  • In five parallel threads downloads the data for those breeds from DogAPI (https://dog.ceo/dog-api/documentation)
  • The results will be saved to CSV files with a header line (each breed into {breed_name}.csv) and contain columns: breed name and link to the image
  • Apart from those csv files the script will also create one file "updated_at.json" in JSON format that will contain a list of all the downloaded files and timestamp of when each of them was created
  • The code should pass the Linter validation with default rubocop settings (https://github.com/rubocop-hq/rubocop)
  • There should be a simple test using Rspec that will succeed on the code with testing/mocked data
  • Put the code to a public repository on GitHub (https://github.com/) and provide us with a link to it.

3. Test and Run

3.1 Rspec test

$ bundle exec rspec

3.2 Run script

$ bundle exec ruby crawl_dog_breeds.rb [breed 1] [breed 2] ...

lhv_crawl_dog_breeds's People

Contributors

gustvn avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.