mediawiki-api

How to get all Wikipedia article titles with MediaWiki API?

荒凉一梦 提交于 2019-12-11 13:44:07
问题 I know you can get all titles from Wikipedia's Database dump and that you can query for specific titles, but how can you get them all through the MediaWiki API? 回答1: For that you would use the Allpages API: https://en.wikipedia.org/w/api.php?action=query&format=json&list=allpages&aplimit=max You will not get all at once but up to 500 at a time and then a continuation marker which you can use for next batch of titles. Continue this until the JSON does not have query-continue in the beginning

Mediawiki API error: Unrecognized value for parameter 'prop': extracts

别来无恙 提交于 2019-12-10 19:54:17
问题 I have a new installation of mediawiki. I am trying to use the API to simply get an article. The API url I am using is: https://example.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor_cisco Upon going to that URL I get: Unrecognized value for parameter 'prop': extracts This seems odd because all of the following urls do work and return the right data: https://example.com/mediawiki/api.php?action=query&format=json&prop=links&titles=Vendor_cisco https://example.com

Get an article summary from the MediaWiki API

女生的网名这么多〃 提交于 2019-12-10 00:33:02
问题 I am looking for a mediawiki api using which I can get short description about any query string. For example , if I search for Nicolas Cage then it should return the short description for him. I tried http://en.wikipedia.org/w/api.php?%20format=json&action=query&titles=Nicolas%20Cage&prop=revisions&rvprop=content I am not sure if prop=revisions is right. My intention is to get a short description on the final version of the page. Also I need another api which can give the link of the

Get random term page from a specific category with wiki api

家住魔仙堡 提交于 2019-12-08 10:13:54
问题 I am trying to get a random term article from the wikipedia. The API:Random page lists only three parameters I can pass to the request. None of them seem to do what I want to achieve. My question is - is it possible to get a random article from a specified category and is it possible to get a term page. Example of what I mean by saying a "term" article - subtraction, reciprocity, api (I can't link the last two because I don't have enough rep). Thanks 回答1: Well yes, but not through the proper

How to fix “readapidenied” error on mediawiki-api in Java

别说谁变了你拦得住时间么 提交于 2019-12-08 10:13:51
问题 I'm working on a project which use the mediawiki API and I have this error : error code=readapidenied info:'You need read permission to use this module.' INFOS: Could not retrieve Mediawiki Version via API - will assume Mediawiki 1.27 or before you might want to set the Version actively if you are on 1.28 and have the api blocked for non-logged in users This is my code : Mediawiki wiki=new Mediawiki(site); Login login=wiki.login(login,password); //error wiki.edit(title, content , summary);

Extract related articles in different languages using Wikidata Toolkit

放肆的年华 提交于 2019-12-07 13:05:40
I'm trying to extract interlanguage related articles in Wikidata dump. After searching on the internet, I found out there is a tool named Wikidata Toolkit that helps to work with these type of data. But there is no information about how to find related articles in different languages. For example, the article: "Dresden" in the English language is related to the article: "Dresda" in the Italiano one. I mean the second one is the translated version of the first one. I tried to use the toolkit, but I couldn't find any solution. Please write some example about how to find this related article. you

MediaWiki Query and/or WikidataQuery to find Wikipedia article

隐身守侯 提交于 2019-12-06 13:24:11
This isn't so much a question abut AngularJS as it is about the Wikimedia and Wikidata query API's. Although I am trying to display the content of a Wikipedia article in AngularJS after doing a certain query that isn't the problem. I already know how to display it... the problem is the search for an article or articles. I'm trying to query Wikipedia by historical event date as well as by geo-location. Let's pick a random event, any event. Let's say " 1986 Mozambican Tupolev Tu-134 crash ". Link: http://en.wikipedia.org/wiki/1986_Mozambican_Tupolev_Tu-134_crash From the article, I can see the

No 'Access-Control-Allow-Origin' header is present. Origin is therefore not allowed access

大城市里の小女人 提交于 2019-12-06 08:33:21
问题 EDIT: No JSONP! Yes i know CORS is handled by the server and Yes the server does support it. The issue is on my side. I am trying to use MediaWiki API from the browser. I am sending a GET request through XMLHttpRequest but due to CORS issues it's just not working. I am getting the following message from my browser after it receives the response: XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?format=json&action=query&list=search&srsearch=Oculus&utf8. No 'Access-Control-Allow

wikipedia api search titles generator

≯℡__Kan透↙ 提交于 2019-12-06 06:11:24
问题 Trying to search tiles through the api using a generator. I notice that there are two possible generators, with both I have problems: prefix search - doesn't work well if I have multiple words and the order is reversed in the query (for example "brian adams" would return an answer, however "adams brian" does not search - seems to not allow searching by titles, only by text which returns low-quality results. Anyone knows of a way around this? 回答1: "srwhat=title" is disabled, so you should use

Wikipedia API: how to get the number of revisions of a page?

我的未来我决定 提交于 2019-12-05 21:12:00
问题 Anyone know how to get the number of revisions of a wikipedia page using mediawiki API? I have read this API documentation, but can't find the related API: Revision API 回答1: The only possibility is to retrieve all revisions and count them. You might need to continue the query for that. Bug 17993 is about including a count, but is still unsolved. 回答2: Here is code to get number of revisions of a page (in this case, the JSON wiki page): import requests BASE_URL = "http://en.wikipedia.org/w/api