This a bot that can take a location and using the Accuweather API to get weather a zip code. The bot was developed to be as the outcome of th IMC bot development tutorial.
- Take input from UI
- Gets intial state from settings
- Return weather for a location by zip code
If you want to test this locally you will need some environment variables; this project supports dotenv. Put your environmental variables into .env
file or export into your shell session if desired.
API_TOKEN
- Used for Requests to Refocus. Created in refoucs/tokens/new.SOCKET_TOKEN
- (Returned Upon Installation) - Used for Socket Connection.ACCUWEATHER_TOKEN
- Private token that Accuweather API gives you so you can make request for current weather
currentZipCode
- The intial zip code for the weather if no other location is specificed in bot data
- Clone this repo
- Add any server side code you want to bot.js
- Add any UI side code to web/index.js
- Comment-out
bdk.installOrUpdateBot(packageJSON);
from ./index.js npm login
- You need to login to get salesforce/bdknpm install
npm start
- Test locally (default port 5000)
- Clone this repo
- Add any server side code you want to index.js
- Add any UI side code to web/index.js
- Install and run Refocus https://salesforce.github.io/refocus/docs/04-quickstartlocal.html
- Create a token https://salesforce.github.io/refocus/docs/10-security.html
- Add token to Bot enviroment variables -
echo "API_TOKEN={{UI TOKEN from Step 5}}" > .env
npm login
- You need to login to get salesforce/bdknpm install
npm start
- If it is your first install you will be returned a
Authorization Token
for sockets - Add authorization token to Bot enviroment variables -
echo "SOCKET_TOKEN={{UI TOKEN from Step 9}}" >> .env
npm start
- Create a RoomType in Refocus with your Bot added
- Create a Room in Refocus with your new RoomType
- Go to
https://host:port/rooms/
and open your new room
If you have any ideas on how this project could be improved, please feel free. The steps involved are:
- Fork the repo on GitHub.
- Clone this project to your machine.
- Commit changes to your own branch.
- Push your work back up to your fork.
- Submit a Pull Request so we can review it!
Follows semantic versioning
- 1.0.0 Bot Created for Tutorial.
- 1.0.1 Using bdk from npm and added licenses.