Documentation
¶
Index ¶
Constants ¶
View Source
const ( FORMAT_WIKI = TextFormat("wiki") FORMAT_TEXT = TextFormat("plain") FORMAT_RAW = TextFormat("raw") )
View Source
const ( // Ranking based on the number of incoming links, some templates, page language and recency (templates/language/recency may not be activated on this wiki). RankingClassic = SearchRanking("classic") // Ranking based on some templates, page language and recency when activated on this wiki. RankingClassicNoBoost = SearchRanking("classic_noboostlinks") // Ranking based solely on query dependent features (for debug only). RankingEmpty = SearchRanking("empty") // Weighted sum based on incoming links RankingIncomingLinks = SearchRanking("wsum_inclinks") //Weighted sum based on incoming links and weekly pageviews RankingIncomingLinksWeeklyViews = SearchRanking("wsum_inclinks_pv") )
View Source
const ( SearchTypeText = SearchType("text") // Search the text of pages. SearchTypeTitle = SearchType("title") // Search only page titles. SearchTypeNearMatch = SearchType("nearmatch") // Search only page titles that begin with the search term. )
View Source
const EN = "en"
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Extracts ¶
type Extracts struct {
Lang string `wiki:"-"`
ID ID `wiki:"id"`
TextOnly bool `wiki:"explaintext"`
TextFormat TextFormat `wiki:"exsectionformat"`
Chars int `wiki:"exchars"` // How many characters to return. Actual text returned might be slightly longer.
Sentences int `wiki:"exsentences"` // How many sentences to return.
OnlyIntro bool `wiki:"exintro"` // Return only content before the first section
// contains filtered or unexported fields
}
The request type for wikipedia extracts module https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bextracts
type Search ¶
type Search struct {
Lang string `wiki:"-"`
Type SearchType `wiki:"srwhat"` // The type of search to perform.
Query string `wiki:"srsearch"` // The search query string.
Limit int `wiki:"srlimit"` // The maximum number of search results to return.
Offset int `wiki:"sroffset"` // The offset for the search results.
Ranking SearchRanking `wiki:"srqiprofile"` // The ranking method to use.
// contains filtered or unexported fields
}
The request type for wikipedia query search module https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bsearch
type TextFormat ¶
type TextFormat string
type Wikipedia ¶
Wikipedia HTTP client
func (*Wikipedia) Extracts ¶
Extracts wikipedia article content https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bimageinfo
Click to show internal directories.
Click to hide internal directories.