|
@ -36,11 +36,24 @@ var ( |
|
|
const minPollingIntervalSeconds = 60 * 5 // 5 min (News feeds can be genuinely spammy)
|
|
|
const minPollingIntervalSeconds = 60 * 5 // 5 min (News feeds can be genuinely spammy)
|
|
|
|
|
|
|
|
|
// Service contains the Config fields for this service.
|
|
|
// Service contains the Config fields for this service.
|
|
|
|
|
|
//
|
|
|
|
|
|
// Example:
|
|
|
|
|
|
// {
|
|
|
|
|
|
// feeds: {
|
|
|
|
|
|
// "http://rss.cnn.com/rss/edition.rss": {
|
|
|
|
|
|
// poll_interval_mins: 60,
|
|
|
|
|
|
// rooms: ["!cBrPbzWazCtlkMNQSF:localhost"]
|
|
|
|
|
|
// },
|
|
|
|
|
|
// "https://www.wired.com/feed/": {
|
|
|
|
|
|
// rooms: ["!qmElAGdFYCHoCJuaNt:localhost"]
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
type Service struct { |
|
|
type Service struct { |
|
|
types.DefaultService |
|
|
types.DefaultService |
|
|
// Feeds is a map of feed URL to configuration options for this feed.
|
|
|
// Feeds is a map of feed URL to configuration options for this feed.
|
|
|
Feeds map[string]struct { |
|
|
Feeds map[string]struct { |
|
|
// The time to wait between polls. If this is less than minPollingIntervalSeconds, it is ignored.
|
|
|
|
|
|
|
|
|
// Optional. The time to wait between polls. If this is less than minPollingIntervalSeconds, it is ignored.
|
|
|
PollIntervalMins int `json:"poll_interval_mins"` |
|
|
PollIntervalMins int `json:"poll_interval_mins"` |
|
|
// The list of rooms to send feed updates into. This cannot be empty.
|
|
|
// The list of rooms to send feed updates into. This cannot be empty.
|
|
|
Rooms []string `json:"rooms"` |
|
|
Rooms []string `json:"rooms"` |
|
|