I wrote this script to get Dictionary.com's Word of The Day on the first line of my terminal when I open a new tab or window.
![image](https://private-user-images.githubusercontent.com/47006111/318577090-a2cede25-16ca-44fa-bf50-bd87d14df286.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3OTU5NDEsIm5iZiI6MTcyNDc5NTY0MSwicGF0aCI6Ii80NzAwNjExMS8zMTg1NzcwOTAtYTJjZWRlMjUtMTZjYS00NGZhLWJmNTAtYmQ4N2QxNGRmMjg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDIxNTQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzN2NkZDBjMTNhZTE2MTRhNDNiZWYxMjEyMzM2ODU5OGZhZGIwMWE4MGU2MWVhMGY4MTUyOWEzODI4NDNmODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JrjGguZgiO9LRUidQ8kXQtlzbr0O5JKzksQC-Yh3YIk)
The script creates a new file wherever it is called and will store the word of the day in JSON format in a file in the same location for caching.
[
{
"date": "2024-04-01",
"word": "naiveté",
"definition": "the quality or state of having or showing a lack of experience or judgment; natural or artless simplicity."
}
]
Once you have downloaded the script add a line to your bash or in my case .zshrc
file to execute the script.
I used ts-node to execute it like so;
ts-node "/path/to/WordOfTheDay.ts"