33 lines
495 B
Go
33 lines
495 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Config struct {
|
|
FeedFile string
|
|
FeedAscend bool
|
|
FriendsFile string
|
|
MaxPosts int64
|
|
Nick string
|
|
}
|
|
|
|
type FeedEntry struct {
|
|
Nick string
|
|
Timestamp time.Time
|
|
Post string
|
|
}
|
|
|
|
type Feed []FeedEntry
|
|
|
|
func (self Feed) Len() int {
|
|
return len(self)
|
|
}
|
|
|
|
func (self Feed) Swap(i, j int) {
|
|
self[i], self[j] = self[j], self[i]
|
|
}
|
|
|
|
func (self Feed) Less(i, j int) bool {
|
|
return self[i].Timestamp.After(self[j].Timestamp)
|
|
}
|