|
|
|
@ -28,8 +28,9 @@ type queueItem struct {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type feedItem struct { |
|
|
|
|
URL string |
|
|
|
|
Date time.Time |
|
|
|
|
URL string |
|
|
|
|
Title string |
|
|
|
|
Date time.Time |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type feed struct { |
|
|
|
@ -115,12 +116,13 @@ func (f *feed) publish() {
|
|
|
|
|
|
|
|
|
|
feedB := tx.Bucket(feedBucket) |
|
|
|
|
key, _ := time.Now().MarshalBinary() |
|
|
|
|
value, err := json.Marshal(feedItem{url, time.Now()}) |
|
|
|
|
value, err := json.Marshal(feedItem{url, getTitle(url), time.Now()}) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Printf("Error adding feed item: %v", err) |
|
|
|
|
} |
|
|
|
|
log.Printf("Publish: %s", url) |
|
|
|
|
feedB.Put(key, value) |
|
|
|
|
queueB.Delete([]byte(url)) |
|
|
|
|
return nil |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -205,7 +207,7 @@ func (f feed) rss() string {
|
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
channel.Item = append(channel.Item, Item{ |
|
|
|
|
Title: item.URL, // TODO
|
|
|
|
|
Title: item.Title, |
|
|
|
|
Link: item.URL, |
|
|
|
|
GUID: item.URL, |
|
|
|
|
PubDate: item.Date.Format(rfc2822), |
|
|
|
|