wikimedia

Validate language code for Wikimedia languages [closed]

*爱你&永不变心* 提交于 2019-12-24 10:47:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I have a shell script that uses Wikidata Query Service (WDQS) to get required data. The SPARQL query that run WDQS takes input parameter language code. Is there a way that I can check in shell script if the input language code is a valid Wikimedia language code as the first column data in below link https://www

Retrieve a list of all Wikipedia languages programmatically

我与影子孤独终老i 提交于 2019-12-22 05:35:16
问题 I need to retrieve a list of all existing languages for a certain wiki project. For example, all Wikivoyage or all Wikipedia languages, just like on their landing pages. I prefer to do this via MediaWiki API , if it's possible. Thanks for your time. 回答1: Approach 3: Using an API in the Wikimedia wiki farm and Extension:Sitematrix https://commons.wikimedia.org/w/api.php?action=sitematrix&smtype=language While this will return all wikis, the matrix knows about, it is easily filtered client side

MediaWiki adjust system message language

爱⌒轻易说出口 提交于 2019-12-12 03:19:45
问题 i had been having a bug, where my system messages are shown in the wrong language. I have got one simple question: How do i set the system message to always be e.g. english or german without adding &uselang=de to the URL. Is there a way to permanently change it in the local settings? 回答1: Yes, you need to change it in your file LocalSettings.php . For example, if you want to use Brazilian Portugese change it to: $wgLanguageCode = 'pt-br'; For more info, see the manual: Manual:$wgLanguageCode

elasticsearch 6 unable to install plugin org.wikimedia.search:extra not compatible

限于喜欢 提交于 2019-12-11 17:08:16
问题 I have installed elastic search version 6.2.3 over docker. I face the following error when trying to install the following elasticsearch plugin org.wikimedia.search:extra Exception in thread "main" java.lang.IllegalArgumentException: plugin [extra] is incompatible with version [6.2.3]; was designed for version [5.5.2] I tried to install the plugin using the following command: RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install org.wikimedia.search:extra:5.5.2.3 I was trying to

Can I use jquery.uls on a MediaWiki wiki to get a language code from the name of a language in English?

家住魔仙堡 提交于 2019-12-11 13:04:56
问题 WikiMedia has a jquery plugin called jquery.uls (Universal Language Selector) for choosing a language in all kinds of fancy ways. All MediaWiki sites seem to have it available to the JavaScript running on them via $.uls . There is documentation for the ULS extension but it seems to only concern itself with the server side and how an end user would interact with it. I want to know if I can use it to obtain a mapping from the English name of a language (such as "Vietnamese") to the ISO 639

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

Retrieve a list of all Wikipedia languages programmatically

徘徊边缘 提交于 2019-12-05 06:59:30
I need to retrieve a list of all existing languages for a certain wiki project. For example, all Wikivoyage or all Wikipedia languages, just like on their landing pages. I prefer to do this via MediaWiki API , if it's possible. Thanks for your time. Approach 3: Using an API in the Wikimedia wiki farm and Extension:Sitematrix https://commons.wikimedia.org/w/api.php?action=sitematrix&smtype=language While this will return all wikis, the matrix knows about, it is easily filtered client side by code [as of now, one of: wiki (Wikipedia), wiktionary , wikibooks , wikinews , wikiquote , wikisource ,

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

馋奶兔 提交于 2019-12-04 03:12:48
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 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. 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.php" TITLE = 'JSON' parameters = { 'action': 'query', 'format': 'json', 'continue': '', 'titles': TITLE, 'prop':

How to add custom global javascript to mediawiki

天涯浪子 提交于 2019-12-03 17:30:15
问题 How can I add a custom javascript file (let's say custom.js ) to a mediawiki installation? For instance, if I put custom.js under the folder resources/lib/ , how do I get that to be loaded on every page? I am not trying to do this as part of an extension, and I would prefer to keep my changes in LocalSettings.php . 回答1: As garryp has already suggested, you can put the JavaScript code into MediaWiki:Common.js. Note that this is not a file, but simply a page you can edit (as an administrator)

How to add custom global javascript to mediawiki

大城市里の小女人 提交于 2019-12-03 07:08:34
How can I add a custom javascript file (let's say custom.js ) to a mediawiki installation? For instance, if I put custom.js under the folder resources/lib/ , how do I get that to be loaded on every page? I am not trying to do this as part of an extension, and I would prefer to keep my changes in LocalSettings.php . As garryp has already suggested, you can put the JavaScript code into MediaWiki:Common.js . Note that this is not a file, but simply a page you can edit (as an administrator) on your wiki. For example, here's the MediaWiki:Common.js page on the English Wikipedia . JavaScript code