mediawiki

How to retrieve data from Wikipedia API using JSON?

和自甴很熟 提交于 2019-11-28 11:32:55
Here I am fetching the data from Wikipedia using following code. but it is not working for me. var playListURL = 'http://en.wikipedia.org/w/api.php?format=json&action=query&titles=India&prop=revisions&rvprop=content&callback=?'; $.getJSON(playListURL ,function(data) { $.each(data.pages, function(i, item) { alert(i); }); }); DEMO LINK :- http://jsfiddle.net/rushijogle/dyeqy/ Use the following code to get the data: $.getJSON(playListURL ,function(data) { $.each(data.query.pages, function(i, item) { alert(item.title); }); }); Demo is at http://jsfiddle.net/dyeqy/3/ var playListURL = 'http://en

How to parse Wikipedia XML with PHP?

眉间皱痕 提交于 2019-11-28 10:34:18
How to parse Wikipedia XML with PHP? I tried it with simplepie, but I got nothing. Here is a link which I want to get its data. http://en.wikipedia.org/w/api.php?action=query&generator=allpages&gaplimit=2&gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content&format=xml Edit code: <?php define("EMAIL_ADDRESS", "youlichika@hotmail.com"); $ch = curl_init(); $cv = curl_version(); $user_agent = "curl ${cv['version']} (${cv['host']}) libcurl/${cv['version']} ${cv['ssl_version']} zlib/${cv['libz_version']} <" . EMAIL_ADDRESS . ">"; curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl

JS: Failed to execute 'getComputedStyle' on 'Window': parameter is not of type 'Element'

穿精又带淫゛_ 提交于 2019-11-28 09:43:41
In short: I am trying to understand the meaning of this TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' The error appears while lunching Mediawiki's VisualEditor, as can be seen here: http://www.wiki.org.il/index.php?title=new-page&veaction=edit The error doesn't enables creating new pages or editing the wiki anonymously. However, with the use of a different skin the error disappears: http://www.wiki.org.il/index.php/Main_Page?useskin=vector The wiki runs on 1.25alpha. I had this same error showing. When I replaced jQuery selector with normal

Mediawiki Extension add Javascript in Header

核能气质少年 提交于 2019-11-28 09:36:58
问题 Hi my problem is that i cant load some javascript file @ my special page extension. I tried it with addscript and some other methods but the only thing what happened was that the javascript was canceled cause no-js of the mediawiki software. In the folder of my extension is a new.js file which i want to have access only on my special page. Here is some code (most of it of the example of the special pages). MyExentions.php <?php if (!defined('MEDIAWIKI')) { echo <<<EOT To install my extension,

android Wikipedia api game

大城市里の小女人 提交于 2019-11-28 07:05:34
问题 Hi i have to make an app with the following requirement: When the user opens the app, it displays the text from a random Wikipedia page. (You’re free to use any logic for grabbing text from a random Wiki page(preferably using REST APIs)) The game requires a minimum of 10 lines of text on the screen. However, we want to show complete paragraphs of text to make it easier to understand the content displayed. Use the least number of paragraphs required to cross the 10 sentence limit. I am able to

Is there any API in Java to access wikipedia data

风流意气都作罢 提交于 2019-11-28 06:51:16
I want to know: is there any API or a query interface through which I can access Wikipedia data? Mediawiki , the wiki platform that wikipedia uses does have an HTTP based API. See MediaWiki API . For example, to get pages with the title stackoverflow, you call http://en.wikipedia.org/w/api.php?action=query&titles=Stackoverflow There are some (incomplete) Java wrappers around the API - see the Client Code - Java section of the API page for more detail. For the use with Java, try http://code.google.com/p/wiki-java . It is only one class, but a great one! I had the same question and the closest I

parse json string from wikimedia using jquery

为君一笑 提交于 2019-11-28 05:42:54
问题 Im tring to get the infobox from wiki pages. For this I'm using wiki api. The following is the url from which I'm getting json data. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles="+first+"&rvsection=0 Where first is a variable containing the article title for Wikipedia. I'm finding it extremely complex to parse this data to make a meaningful html out of it. I was usuing $.each function initially. But the loop is very deep that I had to use 6-7

Where is monobook.js stored in MediaWiki?

这一生的挚爱 提交于 2019-11-28 02:25:05
I am trying to add extra buttons for my wiki editor page and I came across to this page: http://en.wikipedia.org/wiki/User:MarkS/Extra_edit_buttons#Simple_Install In the simple install section, I need to add extra code in monobook.js. However, I cannot find monobook.js in my wiki folder. Can anyone give me some direction? Bergi The "simple install" you linked to is for Wikipedia users who want to enable the gadget from their personal script file . The correct topic would be #Installing XEB on your own Wiki , however I don't fully agree with that ( importScript is deprecated, for example). Your

How to run a query to find a string in blob files?

谁都会走 提交于 2019-11-28 00:46:35
问题 Mediawiki has a table in the database 'text' which contains the page content. It is saved as a [BLOB] file. I would like to run a query to search through all the text on the site to see which pages contain a certain 'string'. How do I run a query to search [blob] files? 回答1: The Mediawiki markup text is stored in the old_text field, which is a mediumblob type. You can query it like any other text-based field. MySQL will cast your string into binary for the query. Note that this is a case

How to make a MediaWiki site multilingual

拥有回忆 提交于 2019-11-27 21:00:02
问题 I've installed a MediaWiki site. I think default MediaWiki supports only one language which is configured during installation. Is there a way in MediaWiki to support two or more languages like wikipedia.org? Available languages for a page should be listed on left side like Wikipedia, and when a user clicks a language, the version of the page in the selected language can be seen. What is the conventional way to support multilingualism? 回答1: There are two different ways to make a multilingual