ChatBotWeatherNotifier is a chatbot that provides weather information via a KakaoTalk channel. It is implemented using Go and the Echo framework, running on an AWS EC2 instance.
my_weatherBot ├── main.go ├── handler/ │ └── weather.go └── README.md
- Provides weather information for user-specified locations via KakaoTalk.
- Delivers temperature, precipitation type, humidity, precipitation amount, and wind speed information by time.
- Supports simple text and image responses.
- Go (version 1.16 or above)
- AWS EC2 instance
- Kakao Developer account and API key
-
Clone the repository.
git clone https://github.com/your-username/ChatBotWeatherNotifier.git cd ChatBotWeatherNotifier
-
Install necessary Go modules.
go mod tidy
-
Run the server on your AWS EC2 instance.
go run main.go
-
Set up the skill server URL in the KakaoTalk chatbot admin center.
-
When the user inputs "Weather in Jamsil" in KakaoTalk, the bot returns the weather information for that location.
{ "version": "2.0", "template": { "outputs": [ { "simpleText": { "text": "14:00 Weather\nSky Status: ☀️ Clear\nPrecipitation Type: None\nTemperature: 25℃\nHumidity: 60%\nPrecipitation: 0mm\nWind Speed: 3m/s\n\n" } } ] } }
- Initializes the server and sets up routing.
- Defines handlers for KakaoTalk chatbot requests.
- Retrieves and formats weather information.
- Uses the Kakao Local API to get location information.
- Uses the Korean Meteorological Administration API to get and process weather data.
-
Manage your API keys (Kakao and weather) using environment variables or a configuration file.
const ( KAKAO_API_KEY = "YOUR_KAKAO_API_KEY" WEATHER_API_KEY = "YOUR_WEATHER_API_KEY" )
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.