music alarm with Linux, nodeJS, Yandex music

Image for post
Image for post

Motivation

  1. Calculate when I should wake up, usually, it is time now plus 8 hours(not easy calculations)
  2. Set alarm
  3. Sleep
  4. Turn off alarm
  5. Go to a computer and turn on Yandex music
  6. Do morning staff
  7. After some time turn off the music

At one point in time, I realized that the number of steps can be reduced to:

  1. Set alarm
  2. Sleep
  3. Do morning staff
  4. After some time turn off the music

Script implementation

run the script

There are two basic ways to manage browser from application code: selenium and the Chromium over DevTools protocol. If you want to run selenium you need to download WebDriver first and it seems like a redundant step. So I grab puppeteer since it will download Chrome automatically.

Possible improvements

Resources

Puppeteer

Reach the next level of focus and productivity with increaser.org.

Image for post
Image for post
Increaser

Written by

Software engineer, creator of increaser.org. More at geekrodion.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store