Skip to content

Commit 2545427

Browse files
committed
Revert changes made accidentally in TibiaNews and Newslist (TibiaURLs to TibiaURL)
1 parent 7a1197d commit 2545427

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/TibiaNews.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type News struct {
1616
Title string `json:"title,omitempty"` // The title of the news.
1717
Category string `json:"category"` // The category of the news.
1818
Type string `json:"type,omitempty"` // The type of news.
19-
TibiaURLs string `json:"url"` // The URL for the news with id.
19+
TibiaURL string `json:"url"` // The URL for the news with id.
2020
Content string `json:"content"` // The news in plain text.
2121
ContentHTML string `json:"content_html"` // The news in HTML format.
2222
}
@@ -45,7 +45,7 @@ func TibiaNewsImpl(NewsID int, rawUrl string, BoxContentHTML string) (NewsRespon
4545
}
4646

4747
NewsData.ID = NewsID
48-
NewsData.TibiaURLs = rawUrl
48+
NewsData.TibiaURL = rawUrl
4949

5050
ReaderHTML.Find(".NewsHeadline").EachWithBreak(func(index int, s *goquery.Selection) bool {
5151
// getting category by image src
@@ -141,7 +141,7 @@ func TibiaNewsImpl(NewsID int, rawUrl string, BoxContentHTML string) (NewsRespon
141141
Information{
142142
APIDetails: TibiaDataAPIDetails,
143143
Timestamp: TibiaDataDatetime(""),
144-
TibiaURLs: []string{rawUrl},
144+
TibiaURLs: []string{rawUrl},
145145
Status: Status{
146146
HTTPCode: http.StatusOK,
147147
},

src/TibiaNews_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestNewsById(t *testing.T) {
3535
assert.Empty(newsArticleJson.News.Title)
3636
assert.Equal("development", newsArticleJson.News.Category)
3737
assert.Equal("ticker", newsArticleJson.News.Type)
38-
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6529", newsArticleJson.News.TibiaURLs)
38+
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6529", newsArticleJson.News.TibiaURL)
3939
assert.Equal("A number of issues related to the 25 years activities have been fixed, including the following: Dragon pinatas that were stuck in the inbox have been changed into dragon pinata kits. The wind-up loco can now be taken even after defeating Lord Retro. The baby seals can now be painted even when the quest The Ice Islands is active. The weight of wallpapers and fairy lights has been increased and their market category has been changed to decoration. A number of typos and map issues have been fixed as well.", newsArticleJson.News.Content)
4040
assert.Equal("A number of issues related to the 25 years activities have been fixed, including the following: Dragon pinatas that were stuck in the inbox have been changed into dragon pinata kits. The wind-up loco can now be taken even after defeating Lord Retro. The baby seals can now be painted even when the quest The Ice Islands is active. The weight of wallpapers and fairy lights has been increased and their market category has been changed to decoration. A number of typos and map issues have been fixed as well.", newsArticleJson.News.ContentHTML)
4141
}
@@ -64,7 +64,7 @@ func TestNews6512(t *testing.T) {
6464
assert.Empty(newsArticleJson.News.Title)
6565
assert.Equal("community", newsArticleJson.News.Category)
6666
assert.Equal("ticker", newsArticleJson.News.Type)
67-
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6512", newsArticleJson.News.TibiaURLs)
67+
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6512", newsArticleJson.News.TibiaURL)
6868
assert.Equal("TibiaData.com has some news to share! First of all, they invite you to participate in their Discord Server. Further, they are now present on GitHub. They are working on their v3, which is still in beta. If you are interested in such things, head on over there to see what is cooking.", newsArticleJson.News.Content)
6969
assert.Equal("<a href=\"https://tibiadata.com\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"noopener\">TibiaData.com</a> has some news to share! First of all, they invite you to participate in their <a href=\"https://tibiadata.com/2021/07/join-tibiadata-on-discord/\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"noopener\">Discord Server</a>. Further, they are now present on <a href=\"https://tibiadata.com/2021/12/tibiadata-has-gone-open-source/\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"noopener\">GitHub</a>. They are working on their <a href=\"https://tibiadata.com/doc-api-v3/v3-beta/\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"noopener\">v3</a>, which is still in beta. If you are interested in such things, head on over there to see what is cooking.", newsArticleJson.News.ContentHTML)
7070
}
@@ -93,7 +93,7 @@ func TestNews504(t *testing.T) {
9393
assert.Empty(newsArticleJson.News.Title)
9494
assert.Equal("community", newsArticleJson.News.Category)
9595
assert.Equal("ticker", newsArticleJson.News.Type)
96-
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=504", newsArticleJson.News.TibiaURLs)
96+
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=504", newsArticleJson.News.TibiaURL)
9797
assert.Equal("A new feedback form has been released today. Help us to find out which websites and magazines are popular in your country by filling out the new questionnaire. In our current poll we are curious about your occupation.", newsArticleJson.News.Content)
9898
assert.Equal("<br/>A new feedback form has been released today. Help us to find out which websites and magazines are popular in your country by filling out the new questionnaire. In our current poll we are curious about your occupation.", newsArticleJson.News.ContentHTML)
9999
}
@@ -122,7 +122,7 @@ func TestNews6481(t *testing.T) {
122122
assert.Equal("New Mounts", newsArticleJson.News.Title)
123123
assert.Equal("development", newsArticleJson.News.Category)
124124
assert.Empty(newsArticleJson.News.Type)
125-
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6481", newsArticleJson.News.TibiaURLs)
125+
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6481", newsArticleJson.News.TibiaURL)
126126
assert.Equal("New mounts have been added to the Store today!\nThe origins of the Emerald Raven, Mystic Raven, and Radiant Raven are shrouded in darkness, as no written record nor tale told by even the most knowing storytellers mentions but a trace of them. Superstition surrounds them, as some see these gigantic birds as an echo of a long forgotten past, while others believe them to herald hitherto unknown events. What is clear is that they are highly intelligent beings which make great companions if they deem somebody worthy.\n\nClick on image to enlarge.\n\nOnce bought, your character can use the mount ingame anytime, no matter if you are a free account or a Premium account.\nGet yourself a corvid companion!Your Community Managers ", newsArticleJson.News.Content)
127127
assert.Equal("<p>New mounts have been added to the Store today!</p>\n<p>The origins of the <strong>Emerald Raven</strong>, <strong>Mystic Raven</strong>, and <strong>Radiant Raven</strong> are shrouded in darkness, as no written record nor tale told by even the most knowing storytellers mentions but a trace of them. Superstition surrounds them, as some see these gigantic birds as an echo of a long forgotten past, while others believe them to herald hitherto unknown events. What is clear is that they are highly intelligent beings which make great companions if they deem somebody worthy.</p>\n<figure><center><img style=\"cursor: pointer;\" src=\"https://static.tibia.com/images/news/emeraldraven_small.jpg\" onclick=\"ImageInNewWindow(&#39;https://static.tibia.com/images/news/emeraldraven.jpg&#39;)\"/></center>\n<figcaption><center><em>Click on image to enlarge.</em></center></figcaption>\n</figure>\n<p>Once bought, your character can use the mount ingame anytime, no matter if you are a free account or a Premium account.</p>\n<p>Get yourself a corvid companion!<br/>Your Community Managers</p> ", newsArticleJson.News.ContentHTML)
128128
}

src/TibiaNewslist.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type NewsItem struct {
1616
News string `json:"news"` // The news in plain text.
1717
Category string `json:"category"` // The category of the news.
1818
Type string `json:"type"` // The type of news.
19-
TibiaURLs string `json:"url"` // The URL for the news with id.
19+
TibiaURL string `json:"url"` // The URL for the news with id.
2020
ApiURL string `json:"url_api,omitempty"` // The URL for the news in this API.
2121
}
2222

@@ -63,7 +63,7 @@ func TibiaNewslistImpl(days int, BoxContentHTML string, handlerURL string) (News
6363
NewsID := p.Query().Get("id")
6464
NewsSplit := strings.Split(NewsURL, NewsID)
6565
OneNews.ID = TibiaDataStringToInteger(NewsID)
66-
OneNews.TibiaURLs = NewsSplit[0] + NewsID
66+
OneNews.TibiaURL = NewsSplit[0] + NewsID
6767

6868
if TibiaDataHost != "" {
6969
OneNews.ApiURL = "https://" + TibiaDataHost + "/v4/news/id/" + NewsID
@@ -86,7 +86,7 @@ func TibiaNewslistImpl(days int, BoxContentHTML string, handlerURL string) (News
8686
Information{
8787
APIDetails: TibiaDataAPIDetails,
8888
Timestamp: TibiaDataDatetime(""),
89-
TibiaURLs: []string{handlerURL},
89+
TibiaURLs: []string{handlerURL},
9090
Status: Status{
9191
HTTPCode: http.StatusOK,
9292
},

src/TibiaNewslist_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ func TestNewsList(t *testing.T) {
4040
assert.Equal("A number of issues related to the 25 years activities have been fixed,...", firstArticle.News)
4141
assert.Equal("development", firstArticle.Category)
4242
assert.Equal("ticker", firstArticle.Type)
43-
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6529", firstArticle.TibiaURLs)
43+
assert.Equal("https://www.tibia.com/news/?subtopic=newsarchive&id=6529", firstArticle.TibiaURL)
4444
assert.Equal("https://unittest.example.com/v4/news/id/6529", firstArticle.ApiURL)
4545
}

0 commit comments

Comments
 (0)