Documentation ¶
Index ¶
Constants ¶
const ErrMoreThanOneInfoBox = domain.Error("More than one info box found")
ErrMoreThanOneInfoBox is used to communicate that more than one info box was found
const ErrNoDate = domain.Error("No date in info box")
ErrNoDate is used to communicate that the info box did not have a date
const ErrNoInfoBox = domain.Error("No info box found. Is this a battle?")
ErrNoInfoBox is used to communicate that no info box was found
const ErrNoPlace = domain.Error("No place in info box")
ErrNoPlace is used to communicate that the info box did not specify a place
const ErrNoResult = domain.Error("No results in info box")
ErrNoResult is used to communicate that the info box did not specify the results
const ErrNoSummaryExtract = domain.Error("No extract found in summary")
ErrNoSummaryExtract is used to communicate that no extract was found in the battle's summary
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportedData ¶ added in v0.2.0
type ExportedData struct { FactionsByID map[int]*wikiactors.Actor CommandersByID map[int]*wikiactors.Actor BattlesByID map[int]*wikibattles.Battle }
ExportedData is the struct used to retrieve all factions, commanders and battles that have been scraped after successive runs of scraper.ScrapeOne. All of these have been normalized by their Wikipedia IDs
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper is the struct encapsulating all the necessary behaviour to scrape battles, one by one, as well as exporting the results into files
func NewScraper ¶
NewScraper creates a new instance of battles.Scraper
func (*Scraper) Data ¶ added in v0.2.0
func (s *Scraper) Data() ExportedData
Data builds a battles.ExportedData struct with all of the scraped data obtained from successive runs of scraper.ScrapeOne