mediawiki-api

How to get image URL property from Wikidata item by API?

自作多情 提交于 2019-12-17 16:23:26
问题 I've made an android app that uses the JSON Google image search API to provide images but I have noticed that Google have stopped supporting it. I have also discovered that Wikidata sometimes provides a image property on some items, however I can't seem to get the URL location of the image using the Wikidata API. Is there any way to get the image URL property from items in Wikidata? 回答1: If some Wikidata item (with ID: Qxxx ) has image (P18) property, you can access it by MediaWiki API: https

Parsing a Wikipedia dump

一世执手 提交于 2019-12-17 10:59:18
问题 For example using this Wikipedia dump: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=lebron%20james&rvprop=content&redirects=true&format=xmlfm Is there an existing library for Python that I can use to create an array with the mapping of subjects and values? For example: {height_ft,6},{nationality, American} 回答1: It looks like you really want to be able to parse MediaWiki markup. There is a python library designed for this purpose called mwlib. You can use python's built

How to nearby interest attraction or interest place of city, location

杀马特。学长 韩版系。学妹 提交于 2019-12-13 23:44:26
问题 How to nearby interest attraction or interest place of city, location? For example image: top box or right box. I want get those information. What have I use? Google Api place or Wiki api? ...and piece request, source code. Thanks 回答1: It sounds like you want the Google Places API. There are lots of demos and code examples on the documentation site. 来源: https://stackoverflow.com/questions/42588096/how-to-nearby-interest-attraction-or-interest-place-of-city-location

Finding and downloading images within the Wikipedia Dump

主宰稳场 提交于 2019-12-13 11:36:56
问题 I'm trying to find a comprehensive list of all images on wikipedia, which I can then filter down to the public domain ones. I've downloaded the SQL dumps from here: http://dumps.wikimedia.org/enwiki/latest/ And studied the DB schema: http://upload.wikimedia.org/wikipedia/commons/thumb/4/42/MediaWiki_1.20_%2844edaa2%29_database_schema.svg/2193px-MediaWiki_1.20_%2844edaa2%29_database_schema.svg.png I think I understand it but when I pick a sample image from a wikipedia page I can't find it

Mediawiki API - limit search (srsearch) to particular category

人盡茶涼 提交于 2019-12-13 04:47:54
问题 Is there a way to limit Mediawiki's srsearch facility to a particular category? For example is it possible to restrict the below search /w/api.php?action=query&list=search&format=json&srsearch=relativity to the Category:Alert_Einstein category? 回答1: Depends on what search engine you are using. CirrusSearch, for example, can do that with the incategory: keyword. 来源: https://stackoverflow.com/questions/34387550/mediawiki-api-limit-search-srsearch-to-particular-category

Get depictions from Wikimedia Commons

巧了我就是萌 提交于 2019-12-13 04:26:45
问题 Wikimedia Commons has a new feature to describe what a picture depicts. Example: Question How to get the "depicts" of a given image, as JSON, using either a wikimedia-android-data-client library call or a REST HTTP request? 回答1: You can use some of the Wikibase APIs (exactly which or how is not well-documented at the moment, I think). E.g. https://commons.wikimedia.org/w/api.php?action=wbgetclaims&format=jsonfm&entity=M78893847 { "claims": { "P180": [ { "mainsnak": { "snaktype": "value",

Cannot authenticate with MediaWiki 1.28 API

无人久伴 提交于 2019-12-13 03:48:01
问题 I'm having problems authenticating with MediaWiki API in MediaWiki 1.28. The API: https://www.mediawiki.org/wiki/API:Main_page My exact attempt: https://github.com/tomasbjerre/git-changelog-lib/tree/feature/medawiki How I'm doing it: Authenticating to http://localhost:8889/w Posting to: http://localhost:8889/w/api.php?action=query&meta=tokens&format=json&type=login Got cookie: mediawiki_session=pnbmq5t2cq8gsnv4cm74lb6f3aa5vbeb; path=/; HttpOnly Response: {"batchcomplete":"","query":{"tokens":

Access copyright info on Wikimedia Commons via api

蹲街弑〆低调 提交于 2019-12-12 23:53:03
问题 I would like to use the MediaWiki API to get the copyright info for an image. When you click on an image in Wikipedia, the page with the image is opened containing a button "more details". Clicking this button you come to a page which contains a "Use this file on the web" link. Clicking this link (runs the script "stockPhoto.call_web();" which) shows a window with the information I would like to get via a MediaWiki API call. I have been looking at "action=query" and all kinds of properties,

How to get the result of “all pages with prefix” using Wikipedia api?

我们两清 提交于 2019-12-12 18:03:25
问题 I wish to use Wikipedia api to extract the result of this page: http://en.wikipedia.org/wiki/Special:PrefixIndex When searching "something" on it, for example this: http://en.wikipedia.org/w/index.php?title=Special%3APrefixIndex&prefix=tal&namespace=4 Then, I would like to access each of the resulting pages and extract their information. What api call might I use? 回答1: You can use list=allpages and specify apprefix . For example: http://en.wikipedia.org/w/api.php?format=xml&action=query&list

Wikimedia API get generator metadata

放肆的年华 提交于 2019-12-12 04:09:50
问题 I want to get pages from Wikimedia Commons and it seems, that I have still not understand the usage of the Wikimedia API. I use the following query https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&format=json&iiprop=url|size|mime|mediatype|extmetadata&iiurlwidth=150&generator=search&gsrsearch=transformation&gsrnamespace=6&gsrlimit=9&gsroffset=0&gsrinfo=totalhits See in API Sandbox Which works great, except that I don't get the grsinfo / generator metadata. But I need the