add untitled feeds
alex wennerberg alex@alexwennerberg.com
Tue, 15 Dec 2020 20:44:40 -0800
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
gemfeed.go
→
gemfeed.go
@@ -46,6 +46,9 @@ feed, err := ParseGemfeed(f, baseUrl, maxUserItems) // TODO make configurable
f.Close() if err == nil { feed.Creator = creator + if feed.Title == "" { + feed.Title = "(Untitled Feed)" + } feed.Url = &baseUrl feedEntries = append(feedEntries, feed.Entries...) }@@ -101,6 +104,9 @@ parsedUrl.Scheme = ""
if time.Now().After(date) { title := strings.Trim(splits[1][10:], " -\t") fe := FeedEntry{title, parsedUrl, date, dateString, &gf} + if fe.Title == "" { + fe.Title = "(Untitled)" + } gf.Entries = append(gf.Entries, &fe) } }