wlbot
is a Node.js based CLI that can be used to make some of the most common API calls that are possible with the WeatherLink v2 API.
- Obtaining a WeatherLink API Key
- Setting Your Environmental Variables
- Installing
wlbot
via npm - Installing
wlbot
Manually via the Github Repository - Calling the CLI
- Upgrading
wlbot
vianpm
- Contributing
- License
- References
No matter how you install wlbot
, it requires that you have a WeatherLink v2 API Key and Secret.
The WeatherLink Developer Portal outlines how to get your API key at https://weatherlink.github.io/v2-api/tutorial:
To retrieve your WeatherLink v2 API Key and API Secret you can go to WeatherLink.com and visit the Account page at https://www.weatherlink.com/account.
Once on the Account page you can click the Generate v2 Key button to create a new WeatherLink v2 API Key and API Secret.
Note: Your API Secret should never be shared with anyone.
No matter how you install wlbot
, it requires several permanent environmental variables to be set. Before running the CLI locally for this first time, you must set the necessary environment variables. The table below specifies the name and value of the environment variables that are required.
Environment Variable Name | Environment Variable Value |
---|---|
WEATHER_LINK_API_KEY |
<your_api_key> |
WEATHER_LINK_API_SECRET |
<your_api_secret> |
WEATHER_LINK_BASE_API_URL |
https://api.weatherlink.com/v2/ |
Note: <your_api_key>
and <your_api_secret>
should be replaced with the API Key and API Secret that you where given when creating your WeatherLink API as described above.
This article describes how you can set permanent environment variables on macos or Linux.
This article describes how you can set permanent environment variables on Windows Operating Systems.
wlbot
is listed on the npm
repository at https://npmjs.com/package/wlbot.
You can globally install the wlbot
CLI by:
- Opening a command line prompt on your machine and running
npm install -g wlbot
.
This process could take a minute or two, depending on your internet connection.
It is easy to get a copy of the wlbot
CLI running locally.
In order to run wlbot
locally, the following will need to be installed on your machine:
- Node.js (required)
- Node.js is required to run
wlbot
- Installation Instructions: https://nodejs.org/en/download/
- Node.js is required to run
- npm (required)
- npm is used to manage the packages needed by
wlbot
to run on top of Node.js - Installation Instructions: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- npm is used to manage the packages needed by
Navigate to the location on your development machine where you want to place this project's directory and clone the repository by running the following command:
git clone https://github.com/mike-weiner/wlbot.git
wlbot
requires several packages to run on top of Node.js. Those packages can be installed by the following command at the root of the directory for this project running:
npm install
Once you have all of the environment variables required by the CLI set, we need to globally install the CLI in npm. This will allow you to call wlbot
on your command line without being in this project's directory.
To globally install the wlbot
package, navigate to the project's root directory on your command line. This should be the directory where this README is found. Then run the following command:
npm i -g .
Note: It is not required that you install wlbot
globally in npm. However, if it is not installed globally you will only be able to call the wlbot
command when you are in the directory where you have this project located.
Congrats! You should now be able to open up a new terminal window and run wlbot
. You can run wlbot -h
to get help understanding how to use this CLI.
wlbot
contains a helpful command to ensure that your environmental variables are set correctly. Run wlbot config
to print out the values of the environmental variables that are required by wlbot
.
You can run wlbot config -l
to list the full values of the environmental variables. Note: Be careful running this command as your WeatherLink API Secret's value will be shown. You don't want to share this with anyone.
There are several commands that you wil