Documentation ¶
Overview ¶
Libsuger is a micro-library for the executable suger. Suger is a tool to crawl and scrape the film classification database of Singapore's Media Development Authority (MDA).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
Crawler is a type that embeds an http.Client and holds state information.
func NewCrawler ¶
NewCrawler returns a pointer to a new Crawler.
type Job ¶
type Job struct { Error error // contains filtered or unexported fields }
Job is a type that stores certain state information used by the Crawl method the Crawler type. Its only exported field is Error, which contains the last error recorded by Crawl method.
func NewJob ¶
NewJob creates a Job from the first result you want to crawl (start) and the number of results (count) that you want to crawl. It returns an error if start or count are less than one.
type Rating ¶
Rating is a simple type to hold a single rating (e.g. "No Children Under 16") and decision (e.g. "Passed Clean").
type Result ¶
type Result struct { URL string // get-able URL of result page HTML []byte // html of the result page Page int // search result page the result was found on Row int // search result row the result was found on }
Result is a type returned through a channel by the Crawl method of the Crawler type. It holds the HTML of a classification database title page.
type Title ¶
Title is a simple type to hold the Name, URL, and various Ratings for a title in the database.