-
Notifications
You must be signed in to change notification settings - Fork 1
WikimediaAPI
ValterVB edited this page Jan 4, 2015
·
1 revision
This is the class to manage all the API request.
WikimediaAPI(string Site, string User, string Password)
-
SiteMediawiki site (ex. https://it.wikipedia.org or https://www.wikidata.org etc.) -
UserLogin user -
PasswordLogin password
WikimediaAPI WD = new WikimediaAPI("https://www.wikidata.org", "User", "Password");
string LoadWD(string Entities, LoadTypeWD Type = LoadTypeWD.All)
-
EntitiesString with entity id separated by|(ex. Q45|P38|Q60) -
TypeWhat retrieve (ex. only label or description or all - return JSON string of entities
wbgetentities&format=json&redirects=yes.string LoadWD(string Site, string Pages, LoadTypeWD Type = LoadTypeWD.All)
-
SiteWikimedia site (ex. itwiki or itwikiquote) -
PagesString with page title separated by|(ex. London|Berlin) -
TypeWhat retrieve (ex. only label or description or all) - return JSON string of entities
wbgetentities&format=json&redirects=yes.string LoadWP(string Pages)
-
PagesString with page title separated by|(ex. London|Berlin) - return JSON string of the pages.
wbgetentities&format=json&redirects=yes.string EditEntity(string id, Dictionary<string, string> links, Dictionary<string, string> labels, Dictionary<string, string> descriptions, Dictionary<string, List<string>> aliases, List<Claim> claims, string summary)
-
identity id (ex. Q564), empty string to create a new entity. -
linksDictionary with sitelinks -
labelsDictionary with labels -
descriptionsDictionary with descriptions -
aliasesDictionary with aliases -
claimsList of claims -
summaryComment of the edit, empty string to auto description
wbeditentity.string SetBadge(string Item, string Sitelink, string Badge)
-
Itementity id (ex. Q564) -
SitelinkSitelink where to add the badge (ex. itwiki) -
BadgeItem of the badge, empty string to delete badge
wbsetsitelink.string SavePage(string Page, string Text, string Summary)
-
PageTitle of the page -
Textext to be saved -
SummaryComment of the edit
edit. Creates a new page if doesn't exist.