An desktop application to display a clock with news headlines and weather forecasts for small displays (e.g. resolution of 800 x 640). This app is developed using Electron framework and web APIs of News API and OpenWeather.
- Displays current time as well as current weather and temperature on your location.
- Displays news headline delivered from News API.
- Displays 3-hour step weather and temperature forecasts for 24 hours.
- The country and category, or source for the news feed can be changed as News API supports.
- Units of temperatures can be changed to Kelvin (K), Fahrenheit (°F), or Celcius (°C).
- Uses free plan API keys of Google, News API, and OpenWeather to acquire geolocation, news feed, and weather forecast data.
- Install Node.js to use Electron framework.
- Acquire API keys from the following web service provides:
- Clone this repository on a directory.
git clone https://github.com/shimmy-void/desktopclock.git
- Install Electron framework on the directory.
cd desktopclock
npm i -D electron
- Make the
api_keys.json
file with your API keys acquired in Prerequisites and save it on the same directory (desktopclock).
{
"geolocation": "<YOUR_GOOGLE_APIKEY>",
"news": "<YOUR_NEWSAPI_APIKEY>",
"weather": "<YOUT_OPENWEATHER_APIKEY>"
}
To start the application, type the following command:
npm start
That is done!
If you want to change settings like news fed country, category, or source, click the button attacked on the left of the display.
It shows the config menu like the following:
On this panel, you can change how the News API feeds and which temperature unit is used.
You can set the news feed type to either of "country & category" or "source" due to the specification of the News API.
The config settings are stored in config.json
, you can also change the settings manually by editting the file.
This application can hide top menu bar and the title by clicking View->Full screen
button or using shortcut key: Ctrl+F
.
To finish the full screen mode, Push
Esc
.
Due to the specification of web APIs with free plan, only restriced numbers of API requests are allowed.
- 40,000 requests per month within Google's $200 no charge service, but Google is adopting pay-as-you-go pricing model, see Google geolocation billing page.
- 100 requests per day
- Articles with 24 hour delay
- 60 requests per minute
- 1,000,000 requests per month ( = 32,258 requests per day, 1,344 requests per hour, or 22 requests per minute )
This application makes API requests as follows:
- Only once during startup
- 1 request per every 15 minutes
- 1 request when closing the config menu
- 1 request per every 15 minutes for the current weather
- 1 request per hour for the forecast
- 2 requests when closing the config menu
If you want to make more requests past the above limitations, upgrade your each API's plan to higher ones or just stop the application and wait until the restrictions are alleviated.
- Node.js v18.14.2
- npm 9.5.1
- Electron 23.1.1
- News API
- OpenWeather