mlxscraper

package
v0.0.0-...-30a0ae6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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) Begin

func (sc *ConditionsScraper) Begin()

Begin starts the scraper

func (*ConditionsScraper) End

func (sc *ConditionsScraper) End()

End stops the scraper

func (*ConditionsScraper) ID

func (sc *ConditionsScraper) ID() string

ID returns the ID of this scraper

func (*ConditionsScraper) Init

func (sc *ConditionsScraper) Init(node sqalx.Node, log *log.Logger) error

Init initializes the 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) Begin

func (sc *ETAScraper) Begin()

Begin starts the scraper

func (*ETAScraper) End

func (sc *ETAScraper) End()

End stops the scraper

func (*ETAScraper) ID

func (sc *ETAScraper) ID() string

ID returns the ID of this scraper

func (*ETAScraper) Init

func (sc *ETAScraper) Init(node sqalx.Node, log *log.Logger) error

Init initializes the scraper

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) Begin

func (sc *FacebookScraper) Begin()

Begin starts the scraper

func (*FacebookScraper) End

func (sc *FacebookScraper) End()

End stops the 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) Begin

func (sc *RSSScraper) Begin()

Begin starts the scraper

func (*RSSScraper) End

func (sc *RSSScraper) End()

End stops the scraper

func (*RSSScraper) ID

func (sc *RSSScraper) ID() string

ID returns the ID of 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) Begin

func (sc *Scraper) Begin()

Begin starts the scraper

func (*Scraper) End

func (sc *Scraper) End()

End stops the scraper

func (*Scraper) ID

func (sc *Scraper) ID() string

ID returns the ID of this scraper

func (*Scraper) Init

func (sc *Scraper) Init(node sqalx.Node, log *log.Logger)

Init initializes the scraper

func (*Scraper) LastUpdate

func (sc *Scraper) LastUpdate() time.Time

LastUpdate returns the last time this scraper detected a change

func (*Scraper) Lines

func (sc *Scraper) Lines() []*types.Line

Lines returns the lines monitored by this scraper

func (*Scraper) Networks

func (sc *Scraper) Networks() []*types.Network

Networks returns the networks monitored by this scraper

func (*Scraper) Running

func (sc *Scraper) Running() bool

Running returns whether the scraper is running

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL