mediawiki-api

Parse birth and death dates from Wikipedia?

丶灬走出姿态 提交于 2020-06-09 11:29:12
问题 I'm trying to write a python program that can search wikipedia for the birth and death dates for people. For example, Albert Einstein was born: 14 March 1879; died: 18 April 1955. I started with Fetch a Wikipedia article with Python import urllib2 opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] infile = opener.open('http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&rvsection=0&titles=Albert_Einstein&format=xml') page2 = infile

How to obtain a list of titles of all Wikipedia articles

元气小坏坏 提交于 2020-05-09 19:31:56
问题 I'd like to obtain a list of all the titles of all Wikipedia articles. I know there are two possible ways to get content from a Wikimedia powered wiki. One would be the API and the other one would be a database dump. I'd prefer not to download the wiki dump. First, it's huge, and second, I'm not really experienced with querying databases. The problem with the API on the other hand is that I couldn't figure out a way to only retrieve a list of the article titles and even if it would need > 4

How to obtain a list of titles of all Wikipedia articles

爱⌒轻易说出口 提交于 2020-05-09 19:31:12
问题 I'd like to obtain a list of all the titles of all Wikipedia articles. I know there are two possible ways to get content from a Wikimedia powered wiki. One would be the API and the other one would be a database dump. I'd prefer not to download the wiki dump. First, it's huge, and second, I'm not really experienced with querying databases. The problem with the API on the other hand is that I couldn't figure out a way to only retrieve a list of the article titles and even if it would need > 4

Extract related articles in different languages using Wikidata Toolkit

随声附和 提交于 2020-01-23 17:57:07
问题 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,

How do you grab an article including the links in a usable format?

ぃ、小莉子 提交于 2020-01-15 07:05:08
问题 I have an internal deployment of mediawiki. In some articles are external links. I have another page that makes API calls to the wiki to pull articles into another website. When I pull those articles in, links do not get pulled in properly. Here is an example. Wiki article: Use [http://example.com THIS LINK] to contact the vendor. API URL: https://mysite.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor API results: Use THIS LINK to contact the vendor. Notice the link

How do you grab an article including the links in a usable format?

懵懂的女人 提交于 2020-01-15 07:04:58
问题 I have an internal deployment of mediawiki. In some articles are external links. I have another page that makes API calls to the wiki to pull articles into another website. When I pull those articles in, links do not get pulled in properly. Here is an example. Wiki article: Use [http://example.com THIS LINK] to contact the vendor. API URL: https://mysite.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor API results: Use THIS LINK to contact the vendor. Notice the link

How do you grab an article including the links in a usable format?

℡╲_俬逩灬. 提交于 2020-01-15 07:04:39
问题 I have an internal deployment of mediawiki. In some articles are external links. I have another page that makes API calls to the wiki to pull articles into another website. When I pull those articles in, links do not get pulled in properly. Here is an example. Wiki article: Use [http://example.com THIS LINK] to contact the vendor. API URL: https://mysite.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor API results: Use THIS LINK to contact the vendor. Notice the link

How do you filter WikiVoyage API results by city?

天大地大妈咪最大 提交于 2020-01-12 14:56:07
问题 I'm currently in the process of trying to use the wikivoyage api. My current api call looks like: en.wikivoyage.org/w/api.php?action=query&list=search&srwhat=text&srsearch=Pari&format=json I can't figure out how to filter my results by city. I can't figure out which parameter to use. These are the two pieces of documentation I am trying to sift through. http://en.wikivoyage.org/w/api.php http://en.wikivoyage.org/wiki/Special%3aApiSandbox 来源: https://stackoverflow.com/questions/18394863/how-do

Media wiki second POST still returns NeedToken result

落花浮王杯 提交于 2020-01-06 08:30:19
问题 After first POST request I get "NeedToken" result then in my second POST request I pass token and sessionid as parameters. Here is my Javascript code: function wiki_auth(login, pass, ref){ $.post(ref+'api.php?action=login&lgname=' + login + '&lgpassword=' + pass + '&format=json', function(data) { if(data.login.result == 'NeedToken') { $.post(ref+'api.php?action=login&lgname=' + login + '&lgpassword=' + pass + '&lgtoken='+data.login.token+'&format=json&sessionid='+data.login.sessionid+'

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

心不动则不痛 提交于 2019-12-30 06:27:48
问题 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. 回答1: 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: