Skip to content
Snippets Groups Projects
Unverified Commit 41b7be40 authored by Seok Won's avatar Seok Won
Browse files

Fix nightmode for weather icon and update README.md

parent 5792117d
No related branches found
No related tags found
No related merge requests found
...@@ -247,15 +247,13 @@ TO-DO: Selenium을 통한 자동 db 업데이트 ...@@ -247,15 +247,13 @@ TO-DO: Selenium을 통한 자동 db 업데이트
POST = /info/weather2 | POST = /info/weather2 |
발화 = "날씨", "아주대 날씨", "날씨 좋아?" ... 발화 = "날씨", "아주대 날씨", "날씨 좋아?" ...
TO-DO: 더 나은 메시지 포맷 찾기
<div align="center"> <div align="center">
<p> <p>
<img width="300" src="https://github.com/Alfex4936/kakaoChatbot-Ajou/blob/main/imgs/weather.jpg"> <img width="300" src="https://github.com/Alfex4936/kakaoChatbot-Ajou/blob/main/imgs/weather.jpg">
</p> </p>
</div> </div>
## [인물 검색](https://github.com/Alfex4936/KakaoChatBot-Golang/blob/main/controllers/infomation.go#L35) ## [인물 검색](https://github.com/Alfex4936/KakaoChatBot-Golang/blob/main/controllers/infomation.go#L65)
POST = /info/prof | POST = /info/prof |
발화 = "인물" 발화 = "인물"
...@@ -270,7 +268,7 @@ TO-DO: 더 나은 발화문 ...@@ -270,7 +268,7 @@ TO-DO: 더 나은 발화문
</p> </p>
</div> </div>
## [도서관 좌석 현황] ## [도서관 좌석 현황](https://github.com/Alfex4936/KakaoChatBot-Golang/blob/main/controllers/infomation.go#L109)
POST = /info/library | POST = /info/library |
발화 = "도서관", "좌석" 발화 = "도서관", "좌석"
...@@ -283,3 +281,17 @@ TO-DO: 더 나은 메시지 포맷 ...@@ -283,3 +281,17 @@ TO-DO: 더 나은 메시지 포맷
<img width="300" src="https://github.com/Alfex4936/kakaoChatbot-Ajou/blob/main/imgs/library.jpg"> <img width="300" src="https://github.com/Alfex4936/kakaoChatbot-Ajou/blob/main/imgs/library.jpg">
</p> </p>
</div> </div>
## [학식 불러오기](https://github.com/Alfex4936/KakaoChatBot-Golang/blob/main/controllers/infomation.go#L135)
POST = /info/meal |
발화 = "오늘 학식", "내일 학생", "내일 교직원", "내일 기숙사" ...
오늘/내일 장소를 입력하면 시간에 맞는 장소의 학식 정보를 불러옵니다.
TO-DO: 더 나은 메시지 포맷
<div align="center">
<p>
<img width="300" src="https://github.com/Alfex4936/kakaoChatbot-Ajou/blob/main/imgs/meal.png">
</p>
</div>
\ No newline at end of file
This diff is collapsed.
...@@ -33,8 +33,8 @@ var Router *gin.Engine ...@@ -33,8 +33,8 @@ var Router *gin.Engine
// CreateURLMappings to make endpoints // CreateURLMappings to make endpoints
func CreateURLMappings() { func CreateURLMappings() {
// gin.SetMode(gin.ReleaseMode) gin.SetMode(gin.ReleaseMode)
gin.SetMode(gin.DebugMode) // gin.SetMode(gin.DebugMode)
Router = gin.New() Router = gin.New()
// Create a limiter struct. // Create a limiter struct.
......
...@@ -53,7 +53,8 @@ func GetWeather() (Weather, error) { ...@@ -53,7 +53,8 @@ func GetWeather() (Weather, error) {
statuses := doc.FindAll("em", "class", "level_text") statuses := doc.FindAll("em", "class", "level_text")
// 날씨 아이콘 // 날씨 아이콘
img := doc.Find("div", "class", "today_weather").Find("i").Attrs()["data-ico"] i := doc.Find("div", "class", "today_weather").Find("i").Attrs()
img := i["data-ico"]
// struct 값 변경 // struct 값 변경
weather.CurrentTemp = currentTempInt weather.CurrentTemp = currentTempInt
...@@ -69,7 +70,7 @@ func GetWeather() (Weather, error) { ...@@ -69,7 +70,7 @@ func GetWeather() (Weather, error) {
weather.UltraDust = statuses[1].Text() weather.UltraDust = statuses[1].Text()
weather.UV = statuses[2].Text() weather.UV = statuses[2].Text()
if strings.Contains(img, "night") { if strings.Contains(i["class"], "night") {
weather.Icon = img + "_night" weather.Icon = img + "_night"
} else { } else {
weather.Icon = img weather.Icon = img
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment