* add rss service

* git ignore rss

* update readme

* go fmt

* maintain map by url

* make rss service multi-tenant

* fixup the feed
This commit is contained in:
Asim Aslam
2021-05-20 14:48:52 +01:00
committed by GitHub
parent 1a4db7c673
commit feee6f3ccd
4 changed files with 73 additions and 72 deletions

View File

@@ -68,7 +68,6 @@ func (e *Rss) fetch(f *pb.Feed) error {
// set the refresh time
fd.Refresh = time.Now()
domain := getDomain(url)
// range over the feed and save the items
for _, item := range fd.Items {
@@ -88,11 +87,10 @@ func (e *Rss) fetch(f *pb.Feed) error {
Id: id,
Title: item.Title,
Summary: item.Summary,
Url: item.Link,
Domain: domain,
Feed: f.Url,
Link: item.Link,
Content: content,
Date: item.Date.Unix(),
Category: f.Category,
})
if err != nil {
return fmt.Errorf("Error saving item: %v", err)

View File

@@ -39,7 +39,7 @@ func NewRss() *Rss {
dateIndex := model.ByEquality("date")
dateIndex.Order.Type = model.OrderTypeDesc
entriesURLIndex := model.ByEquality("url")
entriesURLIndex := model.ByEquality("feed")
entriesURLIndex.Order.Type = model.OrderTypeDesc
entriesURLIndex.Order.FieldName = "date"