Missing handlers but there we goddamn GO
Former-commit-id: 2505146a54acaf18eadfdebf1dd2720889aef795
This commit is contained in:
16
rss/item.go
16
rss/item.go
@@ -22,6 +22,8 @@ type Item struct {
|
||||
TS time.Time
|
||||
}
|
||||
|
||||
type Items []*Item
|
||||
|
||||
func newItem(i *gofeed.Item, contentFilter string) (*Item, error) {
|
||||
item := &Item{
|
||||
Title: i.Title,
|
||||
@@ -88,3 +90,17 @@ func (i *Item) Load(key, ns1 string, ns ...string) error {
|
||||
}
|
||||
return config.Decode(b, i)
|
||||
}
|
||||
|
||||
func (is Items) Len() int {
|
||||
return len(is)
|
||||
}
|
||||
|
||||
func (is Items) Less(i, j int) bool {
|
||||
return is[j].TS.Before(is[i].TS)
|
||||
}
|
||||
|
||||
func (is Items) Swap(i, j int) {
|
||||
k := is[i]
|
||||
is[i] = is[j]
|
||||
is[j] = k
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user