Intentful.ai code challenge.
Ruby "~> 3.2.2"
Clone repository:
$ git clone https://github.com/sbezugliy/smashing.git
Install dependencies:
$ bundle install
Fill required values and execute at the shell terminal
$ ./bin/smashing -month <MMYYYY> -resolution <WIDTH>x<HEIGHT>
As example:
$ ./bin/smashing -month 102020 -resolution 1920x1080
Default values is
You able to adjust some default configuration options at the /lib/smashing/app.rb
module Smashing
class App
extend ::Dry::Configurable
setting :base_url, default: "https://www.smashingmagazine.com/", reader: true
setting :post_name, default: "desktop-wallpaper-calendars", reader: true
setting :month, default: "102020", reader: true
setting :resolution, default: "640x480", reader: true
setting :destination_folder, default: "images/#{App.month}", reader: true
end
end
bundle exec rspec
bundle exec rubocop
Additional possible features:
- Multithreaded downlod mode;
- Implement background jobs/Sidekiq for high amount of objects;
Sergey Bezugliys.bezugliy@gmail.com