Reader form several web sites to collect interesting info and group just in one place, in this example Weather from Spain
A shortcut has been created in webcomposer.sh, so you can run:
./webcomposer.sh
to work with screenshots or:
./webcomposer.sh -f
to work with iframes.
Basically, it cleans the previous files, run the script and open the result.
webcomposer.kts and webscreenshots.kts are self-executables so you can use:
./webcomposer.kts
it works with kscript so alternatively you can use:
kscript webcomposer.kts
you can ensure kscript is working on your computer with:
kscript --help
and install it with:
brew upgrade holgerbrandl/tap/kscript
MORE info about kscript: https://github.com/holgerbrandl/kscript
The current script has villages interesting for the author. You can change to you town just updating the ids on the Config object.
- To include new website just update the queries on Config object. You can take as example the current entries.
- To include new website, create a new class that implement WebSource, e.g. AemetDays
- Add a new entry on Config object with a new key and the properly Id for your requested place
- You should instantiate the new class on // NOTE: Instantiate your class here and read the new config on // NOTE: add your Config entry here
Jsoup is an really useful library to manage html. Info about Jsoup: https://github.com/jhy/jsoup/
To work with screenshot, Selenium (with ChromeDriver) has been chosen. The behaviour changes with a visual browser vs headless one.
Interesting info about corutines: https://medium.com/swlh/everything-you-need-to-know-about-kotlin-coroutines-b3d94f2bc982
Interesting info about chromedriver: To install, you could donwload the same version than your current chrome here: https://chromedriver.storage.googleapis.com/index.html In my case, I choose chromedriver_mac64.zip and it should override the previous version, to ease this process I move this file to ~/ejecutables/chromedriver. This works due to there is symbolic link in /usr/local/bin.