The core idea is to list videos from a youtube channel in decreasing order of like to dislike ratio.
Youtube allows only 10,000 units per day. Youtubedislike api allows 100 calls per minute and 10,000 call per day.
- Make sure you have ruby 3.1.2, redis and postregsql installed
- Clone the repo
- cd into the directory
- run
bundle install
- run
rails db:create
and thenrails db:migrate
- start sidekiq by
bundle exec sidekiq
- open another terminal, cd into project and run
rails s
to start the server locally - The webapp will be available at the given host:port
(optional) tests can be run through bundle exec rspec
-
Sign Up with correct youtube API Key(you can use
AIzaSyD_y9yJRL7bAcwI7Zsy4v7TE-Z_iPeVFm0
). -
Log in to your account.
-
Click on Add Album. Name it Music and save it.
-
Click on Add Channel.
-
Enter
UCewyFby3pwB31EPE1PpCT1Q
in Channel ID and save it. -
Click on Make Request. The API calls will start in background.
-
Go back and click on Videos. You might start to see some videos as they process in the background. Refresh window to see the updated list.
Two of the fields that channel modal have is keywords and nonkeywords which can be a bit confusing. So, if I want certain keywords to be in video title we add through it. Say we want music and lyrical to be present in video title. We enter
music;lyrical
(seperated by semicolons) in the textbox.
- Faraday paralell requests can be used to reduce processing time
- Error handling for quota exhaustion
- Send meaningful popups to user regarding api calls in the background
- go through some of the suggestions made by rubocop
- Tests are flaky
Improve Album model association- Class which processes background job is messy. Better organisation required.
- Move keywords and nonkeywords a part of frontend in filters.