[15:24:37] is this a good place to ask questions about wikimedia API [15:24:40] the wikimedia API* [15:25:09] sure [15:36:07] jesopo, just ask [15:37:04] soz [15:37:09] just gathering the needed into [15:37:12] info* [15:38:25] https://en.wikipedia.org/w/api.php?action=query&prop=extracts&titles=VMX&exintro=&explaintext=&exchars=500&redirects=&format=json [15:38:53] this is a very not-useful output [15:39:41] Right. And what's your question? :) [15:40:00] how can i either detect this scenario or how can i show the disambig options? [15:42:13] removing `exintro` seems useful. [15:43:35] but still not something i can machine-parse [15:48:18] https://en.wikipedia.org/w/api.php?action=parse&page=VMX&prop=wikitext&format=json probably won't help either with that, it's just a bit different. [15:49:34] the usecase I'm working with here is an IRC bot [15:49:39] just fy [15:49:41] fyi* [17:21:30] jesopo, have you already seen https://www.mediawiki.org/wiki/Manual:Creating_a_bot#Python [17:22:05] i have not [17:22:21] I've already written my irc bot [17:22:26] https://github.com/jesopo/bitbot [17:22:38] I'm just looking at integration with the wikimedia (specifically, wikipedia) API [17:22:50] yupyup, i searched, hence I knew which subsection to link you ;) [17:23:01] oh i see [17:23:09] (I am not a dev, cannot help beyond that, sorry) [17:24:36] doesn't look like any of these will help me with my scenario [17:24:38] not sure though [17:24:40] will look further. thanks [17:24:45] :) [17:27:19] jesopo: if you only need to detect disambig pages, you can do it like this: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts%7Cpageprops&titles=VMX%7CDog&redirects=1&exchars=500&exintro=1&explaintext=1&ppprop=disambiguation [17:27:21] jesopo, oh, also: On English Wikipedia (and some others), disambiguation pages are using this feature. https://www.mediawiki.org/wiki/Extension:Disambiguator -- So IIUC, your question is: When my bot detects a disambig page, how can i have the API extract the links on that page [17:27:33] heh, or that. :) [17:28:08] jesopo: showing the options is more difficult, i don't think we have a convenient way to get that. the best you can do is get a list of *all* links on the page, or parse the wikitext yourself to extract what you want [17:28:30] ouch. [17:28:31] https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts%7Cpageprops%7Clinks&titles=VMX&redirects=1&exchars=500&exintro=1&explaintext=1&ppprop=disambiguation [17:29:36] (or parse the HTML to extract them… that might be easier, depending on what kind of tools you're more familiar with :) ) [17:29:54] parsing HTML instead of using an API is a terrible idea [17:55:36] jesopo: the problem is that these things are not "structured data" in MediaWiki. They are just conventions that various wiki communities use in organizing their pages. [17:56:53] https://www.mediawiki.org/wiki/Extension:Disambiguator is a fix for that and does add some API options (see that page for details) [18:51:44] o/ tgr_ [18:51:55] Do you have a minute to look at https://gerrit.wikimedia.org/r/#/c/operations/mediawiki-config/+/419499/ with me? [18:52:22] I'm curious how to interpret "// verylikelybad uses default" [18:52:25] And similar lines.