scraper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CC      = MeetingType{Code: "CC", Name: "City Council", SearchTerms: []string{"citycouncil", "citycouncilmeeting"}}
	DHSC    = MeetingType{Code: "DHSC", Name: "Development & Heritage Standing Committee", SearchTerms: []string{"developmentheritagestandingcommittee", "developmentheritagestandingcommitteemeeting"}}
	Special = MeetingType{Code: "Special", Name: "Special Meeting of Council", SearchTerms: []string{"specialmeetingofcouncil", "specialmeetingofcitycouncil", "specialcitycouncilmeeting", "specialincamerameetingofcouncil", "specialincamerameetingofcitycouncil"}}
	ETP     = MeetingType{Code: "ETP", Name: "Environment, Transportation & Public Safety Standing Committee", SearchTerms: []string{"environmenttransportationpublicsafetystandingcommittee", "environmenttransportationpublicsafetystandingcommitteesittingasthetransitwindsorboardofdirectors"}}
	CSSC    = MeetingType{Code: "CSSC", Name: "Community Services Standing Committee", SearchTerms: []string{"communityservicesstandingcommittee"}}
	Other   = MeetingType{Code: "Other", Name: "Other", SearchTerms: []string{"other", "inauguralmeetingofcitycouncil", "accountabilitytransparencyorientation"}}
)

Functions

This section is empty.

Types

type Document

type Document struct {
	Link     string      `json:"link"`
	Name     string      `json:"name"`
	Meeting  MeetingType `json:"meeting"`
	Date     time.Time   `json:"date"`
	RawTitle string      `json:"rawTitle"`
}

Document represents the metadata associated with a given upstream document.

func GetDocuments

func GetDocuments(ctx context.Context) ([]Document, error)

GetDocuments fetches and parses data from the upstream and returns a slice of Document. It currently only supports PDFs.

type FilterFunc

type FilterFunc func([]Document) []Document

FilterFunc is a function type that returns a subset of the input documents.

func After

func After(t time.Time) FilterFunc

After returns a FilterFunc for documents after a given time.Time

func Before

func Before(t time.Time) FilterFunc

Before returns a FilterFunc for documents before a given time.Time

func ByMeetingType

func ByMeetingType(meeting MeetingType) FilterFunc

ByMeetingType returns a FilterFunc for documents that match a specific MeetingType

func ByStringInName

func ByStringInName(str string) FilterFunc

ByStringInName returns a FilterFunc for a slice of Document that have a given string in its name

func ByYear

func ByYear(year int) FilterFunc

ByYear returns a FilterFunc for documents that match a given year

type MeetingType

type MeetingType struct {
	Code        string `json:"code,omitempty"`
	Name        string `json:"name,omitempty"`
	SearchTerms []string
}

MeetingType defines a meeting with associated search terms

func GetMeetingType

func GetMeetingType(meeting string) MeetingType

GetMeetingType will return the matching MeetingType if the meeting argument matches the Code, Name or any of the search terms.

Jump to

Keyboard shortcuts

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