mediawiki-api

Wikipedia api fulltext search to return articles with title, snippet and image

只愿长相守 提交于 2019-12-02 17:44:22
I've been looking for a way to query the wikipedia api based on a search string for a list of articles with the following properties: Title Snippet/Description One or more images related to the article. I also have to make the query using jsonp. I've tried using the list=search parameter http://en.wikipedia.org/w/api.php?action=query&list=search&prop=images&format=json&srsearch=test&srnamespace=0&srprop=snippet&srlimit=10&imlimit=1 But it seems to ignore the prop=images, I've also tried variations using the prop=imageinfo and prop=pageimages. But they all give me the same result as just using

Searching Wikipedia using API

牧云@^-^@ 提交于 2019-12-02 16:40:29
I want to search Wikipedia using the query action. I am using this url: http://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=apple That works but I want to get into the first result of the search. How can I do that? Note: That url works fine when there is only one result.. I just need the title and some short description. octosquidopus I don't think you can do both in one query. 1. To get the first result, use the Opensearch API . https://en.wikipedia.org/w/api.php?action=opensearch&search=zyz&limit=1&namespace=0&format=jsonfm https://en.wikipedia.org/w/api.php

How to approve new articles and edits in Mediawiki?

旧时模样 提交于 2019-12-01 06:15:54
When users create or edit articles I want to approve them first and then publish them. How can I achieve that or What extension make this possible? Try the FlaggedRevs extension. It adds a status to each article, the status can change when the article is edited (based on the permissions of the editor), and certain user groups can change the status by hand. You can use the status to hide the article from readers or show them the last approved state. The extension is used in several Wikimedia projects so it is reliably maintained. Its main disadvantage is that it is very flexible and has way

MediaWiki URL parameters without values

删除回忆录丶 提交于 2019-12-01 04:44:28
The query part of a URL seems to consist of key-value pairs separated by & and associated by = . I've taken to always using jQuery's $.param() function to URL-encode my query strings because I find it makes my code more readable and maintainable. In the past couple of days I find myself calling the MediaWiki API but when cleaning up my working prototype with hard-coded URLs to use $.param() I noticed some MediaWiki APIs include query parameters with keys but not values! api.php ? action=query & titles=Main%20page & redirects Notice the part &redirects , which takes no value. jQuery's $.param()

How to approve new articles and edits in Mediawiki?

吃可爱长大的小学妹 提交于 2019-12-01 04:18:45
问题 When users create or edit articles I want to approve them first and then publish them. How can I achieve that or What extension make this possible? 回答1: Try the FlaggedRevs extension. It adds a status to each article, the status can change when the article is edited (based on the permissions of the editor), and certain user groups can change the status by hand. You can use the status to hide the article from readers or show them the last approved state. The extension is used in several

Retrieve another language of a Wikipedia page

喜欢而已 提交于 2019-11-30 22:27:19
Task: We have Wikipedia English page and need to retrieve the same page address in Russian. I know the Semantic Web solution - use simple query to DbPedia, but I am curious whether there are traditional solutions. I have asked the same question in semanticoverflow.com where Toby Inkster suggested to parse http://en.wikipedia.org/wiki/Colugo?action=raw results (there are other languages links in the bottom), but this way is too inefficient. Are there any other ways or DbPedia is the one real option? Wikipedia has an extensive API , which can provide language links information among others. In

Get all Wikidata items that are an instance of a given item

眉间皱痕 提交于 2019-11-30 20:21:42
Wikidata has an item called smartphone model . I want to get all instances of it. QUESTION: How to get the identifiers of the instances programmatically, using the live server? Preferably not including false positives that show up in WhatLinksHere but are in the "Wikidata:" namespace rather than the main namespace. Your question specifies the "Mediawiki API" but this is not possible. Wikidata has a SPARQL query service at https://query.wikidata.org The query that you want is: PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT DISTINCT ?item

Retrieve another language of a Wikipedia page

故事扮演 提交于 2019-11-30 17:52:53
问题 Task: We have Wikipedia English page and need to retrieve the same page address in Russian. I know the Semantic Web solution - use simple query to DbPedia, but I am curious whether there are traditional solutions. I have asked the same question in semanticoverflow.com where Toby Inkster suggested to parse http://en.wikipedia.org/wiki/Colugo?action=raw results (there are other languages links in the bottom), but this way is too inefficient. Are there any other ways or DbPedia is the one real

PHP connecting to MediaWiki API and retrieve data

断了今生、忘了曾经 提交于 2019-11-30 07:39:08
问题 I noticed there was a question somewhat similar to mine, only with c#:link text. Let me explain: I'm very new to the whole web-services implementation and so I'm experiencing some difficulty understanding (especially due to the vague MediaWiki API manual). I want to retrieve the entire page as a string in PHP (XML file) and then process it in PHP (I'm pretty sure there are other more sophisticated ways to parse XML files but whatever): Main Page wikipedia. I tried doing $fp = fopen($url,'r');

How to get plain text out of wikipedia

梦想的初衷 提交于 2019-11-29 21:02:15
I've been searching for about 2 months now to find a script that gets the Wikipedia description section only. (It's for a bot i'm building, not for IRC.) That is, when I say /wiki bla bla bla it will go to the Wikipedia page for bla bla bla , get the following, and return it to the chatroom: "Bla Bla Bla" is the name of a song made by Gigi D'Agostino. He described this song as "a piece I wrote thinking of all the people who talk and talk without saying anything". The prominent but nonsensical vocal samples are taken from UK band Stretch's song "Why Did You Do It" Here is the closest I've found