Documentation ¶
Index ¶
- type ConditionsScraper
- type ETAScraper
- type FacebookScraper
- func (sc *FacebookScraper) Announcements(source string) []*types.Announcement
- func (sc *FacebookScraper) Begin()
- func (sc *FacebookScraper) End()
- func (sc *FacebookScraper) ID() string
- func (sc *FacebookScraper) Init(log *log.Logger, newAnnCallback func(announcement *types.Announcement))
- func (sc *FacebookScraper) Networks() []*types.Network
- func (sc *FacebookScraper) Running() bool
- func (sc *FacebookScraper) Sources() []string
- type RSSScraper
- func (sc *RSSScraper) Announcements(source string) []*types.Announcement
- func (sc *RSSScraper) Begin()
- func (sc *RSSScraper) End()
- func (sc *RSSScraper) ID() string
- func (sc *RSSScraper) Init(log *log.Logger, newAnnCallback func(announcement *types.Announcement))
- func (sc *RSSScraper) Networks() []*types.Network
- func (sc *RSSScraper) Running() bool
- func (sc *RSSScraper) Sources() []string
- type Scraper
- func (sc *Scraper) Begin()
- func (sc *Scraper) End()
- func (sc *Scraper) ID() string
- func (sc *Scraper) Init(node sqalx.Node, log *log.Logger)
- func (sc *Scraper) LastUpdate() time.Time
- func (sc *Scraper) Lines() []*types.Line
- func (sc *Scraper) Networks() []*types.Network
- func (sc *Scraper) Running() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionsScraper ¶
type ConditionsScraper struct { EndpointURL string BearerToken string Network *types.Network Source *types.Source HTTPClient *http.Client Period time.Duration ConditionCallback func(condition *types.LineCondition) // contains filtered or unexported fields }
ConditionsScraper is a scraper for Metro de Lisboa line conditions
func (*ConditionsScraper) ID ¶
func (sc *ConditionsScraper) ID() string
ID returns the ID of this scraper
func (*ConditionsScraper) Running ¶
func (sc *ConditionsScraper) Running() bool
Running returns whether the scraper is running
type ETAScraper ¶
type ETAScraper struct { EndpointURL string BearerToken string Network *types.Network HTTPClient *http.Client Period time.Duration NewETACallback func(eta *types.VehicleETA) // contains filtered or unexported fields }
ETAScraper is a scraper for Metro de Lisboa vehicle ETAs
func (*ETAScraper) Running ¶
func (sc *ETAScraper) Running() bool
Running returns whether the scraper is running
type FacebookScraper ¶
type FacebookScraper struct { AccessToken string Network *types.Network Period time.Duration // contains filtered or unexported fields }
FacebookScraper is an announcement scraper for the Metro de Lisboa Facebook page It reads the Facebook feed using the Facebook API
func (*FacebookScraper) Announcements ¶
func (sc *FacebookScraper) Announcements(source string) []*types.Announcement
Announcements returns the announcements read by this scraper
func (*FacebookScraper) ID ¶
func (sc *FacebookScraper) ID() string
ID returns the ID of this scraper
func (*FacebookScraper) Init ¶
func (sc *FacebookScraper) Init(log *log.Logger, newAnnCallback func(announcement *types.Announcement))
Init initializes the scraper
func (*FacebookScraper) Networks ¶
func (sc *FacebookScraper) Networks() []*types.Network
Networks returns the networks monitored by this scraper
func (*FacebookScraper) Running ¶
func (sc *FacebookScraper) Running() bool
Running returns whether the scraper is running
func (*FacebookScraper) Sources ¶
func (sc *FacebookScraper) Sources() []string
Sources returns the sources provided by this scraper
type RSSScraper ¶
type RSSScraper struct { ScraperID string URL string Network *types.Network Period time.Duration // contains filtered or unexported fields }
RSSScraper is an announcement scraper for the Metro de Lisboa website It reads the RSS feed from the official website
func (*RSSScraper) Announcements ¶
func (sc *RSSScraper) Announcements(source string) []*types.Announcement
Announcements returns the announcements read by this scraper
func (*RSSScraper) Init ¶
func (sc *RSSScraper) Init(log *log.Logger, newAnnCallback func(announcement *types.Announcement))
Init initializes the scraper
func (*RSSScraper) Networks ¶
func (sc *RSSScraper) Networks() []*types.Network
Networks returns the networks monitored by this scraper
func (*RSSScraper) Running ¶
func (sc *RSSScraper) Running() bool
Running returns whether the scraper is running
func (*RSSScraper) Sources ¶
func (sc *RSSScraper) Sources() []string
Sources returns the sources provided by this scraper
type Scraper ¶
type Scraper struct { EndpointURL string BearerToken string StatusCallback func(status *types.Status) Network *types.Network Source *types.Source Period time.Duration HTTPClient *http.Client // contains filtered or unexported fields }
Scraper is a scraper for the status of Metro de Lisboa
func (*Scraper) LastUpdate ¶
LastUpdate returns the last time this scraper detected a change