// Return true if the client is logged in. func checkLogin(client *mwclient.Client) bool { params := params.Values{ "action": "query", "assert": "user", "continue": "", } _, err := client.Get(params) return err == nil }
func requestCategories(page string, client *mwclient.Client) *jason.Object { params := params.Values{ "action": "query", "titles": page, "prop": "categories", "cllimit": "max", } json, err := client.Get(params) if err != nil { panic(err) } return json }
// Return a json object containing page title and imageinfo (Exif) data. func GetImageinfo(page string, client *mwclient.Client) *jason.Object { params := params.Values{ "action": "query", "titles": page, "prop": "imageinfo", "iiprop": "commonmetadata", "redirects": "", // follow redirects "continue": "", } json, err := client.Get(params) if err != nil { panic(err) } return mwlib.GetJsonPage(json) }