wikipedia-api

Json deserialize from wikipedia api with c#

一曲冷凌霜 提交于 2020-01-13 06:43:52
问题 I have a wikipedia api with json format. Now I want to get the extract information from this api. I want to make it dynamic for any wikipedia api. [My wikipedia api][1]. I got following information from jsontoCsharp namespace Json_deserialize { public class pageval { public int pageid { get; set; } public int ns { get; set; } public string title { get; set; } public string extract { get; set; } } public class Query { public Dictionary<string, pageval> pages { get; set; } } public class Limits

How to get information from movies Wikipedia category by API?

时光怂恿深爱的人放手 提交于 2020-01-11 11:25:13
问题 Is it possible to fetch information from Wikipedia API by movies category? e.g I've a url which search avatar but I don't know how to search avatar movie. https://en.wikipedia.org/w/api.php?&titles=avatar&format=xml&action=query&prop=extracts|categories|categoryinfo|pageterms|pageprops|pageimages&exintro=&explaintext=&cllimit=max&piprop=original 回答1: It will not be easy by "movies category" because there are a lot of nested categories, but you can use something else - all articles about movie

How to speed up program that finds the shortest path between two wikipedia articles

三世轮回 提交于 2020-01-03 04:58:30
问题 I recently coded a program that finds the shortest path between two wikipedia articles. The problem is getting ALL the links from a page and putting them into a graph is taking a long time. Finding the path is the easy part. Basicly what I'm doing is this: startingPage = 'Lisbon' target = 'Adolf Hitler' graph = nx.DiGraph() graph.add_node(startingPage) found = pages.import_page(graph, startingPage) while found != True: for node in list(graph): if graph.out_degree(node) == 0: found = pages

How to get Infobox from a Wikipedia article by Mediawiki API?

↘锁芯ラ 提交于 2019-12-28 02:40:13
问题 Wikipedia articles may have Infobox templates. By the following call I can get the first section of an article which includes Infobox. http://en.wikipedia.org/w/api.php?action=parse&pageid=568801&section=0&prop=wikitext What I want is a query which will return only Infobox data. Is this possible? 回答1: You can do it with a url call to the Wikipedia API like this: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xmlfm&titles=Scary%20Monsters%20and%20Nice

Wikipedia Search API [closed]

為{幸葍}努か 提交于 2019-12-24 13:42:23
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am trying to code a Wikipedia search and return script. What I am trying to achieve is when a user enters a search query in my text box, it searches Wikipedia for that query and returns the result. very simple

Changing an inner object property to an array in TypeScript

风格不统一 提交于 2019-12-24 11:27:50
问题 There was such a problem, I have been suffering for a couple of days, I am still quite a novice. Using the GET request to the Wikipedia API, I get this object It turns out that for the pages object, the name of the property (which is also an object) is always equal to pageid (in this case "9475"). How can I get access to this object if I don’t know in advance what name it will have? Then this object must be converted to an array so that ngFor can be used. This object I get using the

API for getting edits on Wikipedia

两盒软妹~` 提交于 2019-12-24 09:48:42
问题 I want to get the text of the edit made on a Wikipedia page before and after the edit. I have this url: https://en.wikipedia.org/w/index.php?diff=328391582&oldid=328391343 But, I want the text in the json format so that I can directly use it in my program. Is there any API provided by MediaWiki that gives me the old and new text after an edit or do I have to parse the HTML page using a parser? 回答1: Try this: https://www.mediawiki.org/wiki/API:Revisions There are a few options which may be of

Retrieve first paragraph of Wikipedia article

依然范特西╮ 提交于 2019-12-24 00:16:53
问题 I've been trying to understand the MediaWiki documentation for the past 2 days and I can't figure out how to retrieve the first paragraph of a Wikipedia article through the MediaWiki API. Could someone point me to the right direction? I am about to appeal to file_get_contents, but I'm confident there's a "cleaner" solution. 回答1: Don't try to use the raw API, instead use a client wrapper. Here's a long list to choose from, all for PHP: http://en.wikipedia.org/wiki/Wikipedia:PHP_bot_framework

Getting search results from wikidata website, but not API

橙三吉。 提交于 2019-12-23 20:17:45
问题 I'm trying out the wikidata API but have some trouble with the search query "Jas 39 C Gripen". It returns results on the wikidata website, but not if I use the API. On The wikidata website I get two search results for the query https://www.wikidata.org/w/index.php?search=Jas+39+C+Gripen&title=Special:Search&fulltext=1 The same query using the API, does not return a result https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&language=en&type=item&continue=0&search=Jas%2039