Documentation ¶
Index ¶
- func FetchWikitext(w *mwclient.Client, pageID string) (content string, err error)
- func GetCategorisationTimestampFromPage(page *jason.Object, category string) (timestamp string)
- func GetContentFromPage(page *jason.Object) (content string, err error)
- func GetPagesFromQuery(resp *jason.Object) []*jason.Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchWikitext ¶
FetchWikitext takes a client and a pageId and gets the wikitext of that page. The default functionality in the library does not work for this in my experience; it just returns an empty string for some reason. So we're rolling our own!
func GetCategorisationTimestampFromPage ¶
GetCategorisationTimestampFromPage takes a page, and gets the timestamp at which the page was categorised. All the errors in this function are Fatal, because frankly, if something's gone wrong with the timestamp reading, we're not really going to be able to run the algorithm correctly anyway.
func GetContentFromPage ¶
GetContentFromPage turns a *jason.Object for a Page into the main slot content, and/or an applicable error.
Yes, there is a function to do this already in the library (GetPagesByName). No, I don't want to use it. Why? We've already got the page content here - making another request to get it again is wasteful when we could just locally parse what we already have.
Types ¶
This section is empty.