wikipedia

package
v0.0.0-...-95e20c2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetColumnCountFromTr

func GetColumnCountFromTr(rowHtml string) (int, int, error)

GetColumnCountFromTr takes in a table row and returns the amount of actual td elements and then the amount of tds taking into account colspan values

func GetNextTableAndItsEndPosition

func GetNextTableAndItsEndPosition(sectionHtml string) (string, int)

func ParseDateFromTd

func ParseDateFromTd(tdHtml string) string

Types

type PageSectionInfo

type PageSectionInfo struct {
	Title    string        `json:"title"`
	PageId   int64         `json:"pageid"`
	Sections []SectionInfo `json:"sections"`
}

type SectionInfo

type SectionInfo struct {
	TocLevel   int    `json:"toclevel"`
	Level      string `json:"level"`
	Heading    string `json:"line"`
	Number     string `json:"number"`
	Index      string `json:"index"`
	FromTitle  string `json:"fromtitle"`
	ByteOffset int32  `json:"byteoffset"`
	Anchor     string `json:"anchor"`
	LinkAnchor string `json:"linkAnchor"`
}

type VolumeInfo

type VolumeInfo struct {
	Name        string
	ReleaseDate *time.Time
}

func GetVolumeInfo

func GetVolumeInfo(userAgent, title string, slugOverride *string, tablesToParseOverride *int, verbose bool) []VolumeInfo

func ParseWikipediaTableToVolumeInfo

func ParseWikipediaTableToVolumeInfo(namePrefix, tableHtml string) []VolumeInfo

type WikipediaSectionInfo

type WikipediaSectionInfo struct {
	Parse PageSectionInfo `json:"parse"`
}

Jump to

Keyboard shortcuts

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