Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Adds a method to SlackIntegration.java that returns a formatted String to pass to Slack as a message
Currently there is an issue with the Mesonet API where the "weather condition" information hasn't been updated since October 30, so until it gets fixed it won't get included in Weatherbot's Slack response
This commit implements two separate threads, one to make API calls to the Mesonet API, and one to continually listen for Slack messages to respond to. This way there is no chance that a message will get skipped because the program is making the API call instead of listening for messages.
Previously, API tokens for the Slack integration were stored as an environment variable, and the API token for the Mesonet API was hardcoded into the URL string. This commit places both tokens into a config.properties file and reads them from there, and puts config.properties into the .gitignore, so that API keys can remain separate and private among different users. config.sample.properties was created as a quick guide to the structure of the config.properties. The old API key that was hardcoded into the URL string has been disabled and replaced with a new key in the config.properties file for security purposes.
In the PropertyIO class there were some best-practice issues that were fixed in this commit, such as an InputStream not in a try-with-resouces, a caught exception printing the error instead of the stack trace, and a potential race condition when the program starts
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.