Skip to content

Commit

Permalink
Prevent from getting the same article two days in a row
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteWise committed Dec 24, 2023
1 parent 515f640 commit 7d85cce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ func searchArticle(channelID string) string {
if href_, exists := a.Attr("href"); exists {
long_href := e.Request.AbsoluteURL(href_)
href = strings.Split(long_href, "?source")[0]
setupData.PreviousArticle = href
serializeData(CONFIG_SOURCE, setupData)
if setupData.PreviousArticle != "" && setupData.PreviousArticle != href {
setupData.PreviousArticle = href
serializeData(CONFIG_SOURCE, setupData)
}
}
}
})
Expand Down

0 comments on commit 7d85cce

Please sign in to comment.