Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusLink ¶
type BusLink struct {
// Name Bus name
//
// extracted from button's b tag
Name string `json:"name"`
// Route Bus Route
Route string `json:"route,omitempty"`
// WindowOpenLink a Extracted URL from button's onclick attribute
WindowOpenLink string `json:"windowOpenLink"`
}
BusLink Link information from `button` element
func (*BusLink) ExtractBusNumber ¶
ExtractBusNumber Extract Bus number using regexp and return exact bus number
type BusLinkExtractor ¶
type BusLinkExtractor struct {
// Doc Goquery Document
Doc *goquery.Document
// URL a Request URL to make full bus timetable url
URL string
}
BusLinkExtractor Bus List Extractor
func NewBusListExtractor ¶
func NewBusListExtractor(r io.Reader, urls ...string) (*BusLinkExtractor, error)
NewBusListExtractor Create new BusListExtractor from Reader
type BusTimetable ¶
type BusTimetable struct {
// Stops name of bus stops
Stops []string `json:"stops"`
// Timetables List of bus timetables
Timetables []*Timetable `json:"timetables"`
}
BusTimetable Bus Timetable Information
type BusTimetableExtractor ¶
type BusTimetableExtractor struct{}
TimetableExtractor Bus Timetable Extractor
func NewBusTimetableExtractor ¶
func NewBusTimetableExtractor() *BusTimetableExtractor
NewBusTimetableExtractor Create a new TimetableExtractor
func (*BusTimetableExtractor) Extract ¶
func (bte *BusTimetableExtractor) Extract(ctx context.Context, b *BusLink) (*BusTimetable, error)
Click to show internal directories.
Click to hide internal directories.