mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
Rss (#118)
* 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:
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user