Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
rss module log with RSS tag
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Jul 15, 2021
1 parent 7fd672a commit 6e2f386
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/server_rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func (s *Server) updateRSS() {
rss = strings.TrimSpace(rss)
feed, err := fp.ParseURL(rss)
if err != nil {
log.Printf("parse feed err %s", err.Error())
log.Printf("RSS: parse feed err %s", err.Error())
continue
}

if s.Debug {
log.Printf("retrived feed %s from %s", feed.Title, rss)
log.Printf("RSS: retrived feed %s from %s", feed.Title, rss)
}

if oldmark, ok := s.rssMark[rss]; ok {
Expand All @@ -54,13 +54,13 @@ func (s *Server) updateRSS() {
}
}
if lastIdx > 0 {
log.Printf("feed updated with %d new items", lastIdx)
log.Printf("RSS: feed updated with %d new items", lastIdx)
s.rssMark[rss] = feed.Items[0].GUID
s.rssCache = append(feed.Items[:lastIdx], s.rssCache...)
}
} else if len(feed.Items) > 0 {
if s.Debug {
log.Printf("retrive %d new items, first record", len(feed.Items))
log.Printf("RSS: retrive %d new items, first record", len(feed.Items))
}
s.rssMark[rss] = feed.Items[0].GUID
s.rssCache = append(feed.Items, s.rssCache...)
Expand Down

0 comments on commit 6e2f386

Please sign in to comment.