Movatterモバイル変換


[0]ホーム

URL:


Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
List overview
Download

Mediawiki-apiNovember 2011

mediawiki-api@lists.wikimedia.org
  • 6 participants
  • 6 discussions
Start a nNew thread

20 Jan '26
Hi there,I'm using the API to extract the raw wiki text from my pages, usingthe "?action=query&titles=Main_Page&export&exportnowrap" syntax. Thatworks perfectly.Now I would like to get the templates expanded out in the result, so Iuse: "?action=query&titles=Main_Page&prop=revisions&rvlimit=1&rvprop=content&rvexpandtemplates",which does the job, as expected, but it also strips out the comments.My problem is that the comments are meaningful to me (I use them tohelp process the wiki text in subsequent steps).Is there a way to expand templates with the API, but leave thecomments intact?Thanks,Kevin
4 5
0 0
Need to extract abstract of a wikipedia page
by aditya srinivas 23 Nov '23

23 Nov '23
Hello,I am writing a Java program to extract the abstract of the wikipedia pagegiven the title of the wikipedia page. I have done some research and foundout that the abstract with be in rvsection=0 So for example if I want the abstract of 'Eiffel Tower" wiki page then I amquerying using the api in the following way.http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Eiffel…and parse the XML data which we get and take the wikitext in the tag <revxml:space="preserve"> which represents the abstract of the wikipedia page.But this wiki text also contains the infobox data which I do not need. Iwould like to know if there is anyway in which I can remove the infobox dataand get only the wikitext related to the page's abstract Or if there is anyalternative method by which I can get the abstract of the page directly.Looking forward to your help.Thanks in AdvanceAditya Uppu
4 3
0 0

08 Dec '11
Hi,I'm creating a .Net library to access the API, but I'm not sure how toapproach selecting what properties should the result have.For example, when the user wants to access “info” of some page, I wantto offer him all the available properties. And if he selects “length”and “fullurl”, I should form URL likehttp://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Main%20Page…The “length” property is included by default, and “fullurl” is addedby “inprop=url”.I can get most other information about the structure of the API byusing “action=paraminfo”, but information about what result propertiesare available and how they correspond to the prop values seems to bemissing.Is this information available somewhere? Is trying the query andseeing what properties are returned the best I can do currently? Doyou think it would be a good idea if I (or someone else) modified“action=paraminfo” to include this information in some form?Petr Onderka[[en:User:Svick]]
2 2
0 0
Bad edit token with FauxRequest
by Adam Nielsen 29 Nov '11

29 Nov '11
Hi all,I'm just updating one of my extensions[1] for MW 1.18 and one limitation I am coming across is that it doesn't seem possible for a normal user to mark edits as 'bot', even when those edits are being performed on the user's behalf in a bot-like fashion.As my extension allows normal users to perform large numbers of edits in bulk, it would be nice if the edits could be marked bot, even when the user performing them is not considered a bot.Is there a way to do this when using the API to perform edits within an extension? Or would it be better to dispense with the API and call the various functions manually?I was originally using the FauxRequest class for this, but with 1.18 I had to change it to DerivativeRequest (in order for it to accept the edit token) if that helps.Many thanks,Adam.[1]http://www.mediawiki.org/wiki/Extension:MassEditRegex
2 1
0 0
Hi, I have a question about the functionality of the API onzh.wikipedia.org:It appears that the API isn't performing redirects that involve conversionof certain simplified Chinese page titles to traditional, but theseredirects _are_ supported by the wiki's frontend. For example:When I enterhttp://zh.wikipedia.org/wiki/���ŷɼ� into my browser, thisredirects automatically tohttp://zh.wikipedia.org/wiki/���T�w��.But when I do the equivalent query through the api with redirects enabled (http://zh.wikipedia.org/w/api.php?action=query&titles=���ŷɼ�&redirects), Iget no results.Other simplified to traditional redirects do work in both the frontend andthe API. For example bothhttp://zh.wikipedia.org/wiki/�й�andhttp://zh.wikipedia.org/wiki/�Ї� lead to the same page. I do notice thathere, unlike in my previous example, the request for the simplified titleshows on the page that the results are a redirect(���ض������й�<http://zh.wikipedia.org/w/index.php?title=%E4%B8%AD%E5%9B%BD&redirect=no>��), so something different must be going on.Does anyone know what's going on here, or is there another Chinese languageforum I should address this question to?Many thanks,Joel
4 4
0 0

23 Nov '11
Hi All,Will the useformat=mobile be supported by MediaWiki API where appropriate?I am able to do the following for non mobile content$.getJSON('http://en.wikipedia.org/w/api.php?action=parse&page='+encodeURIComponent(query)+'&prop=text&format=json&callback=?', function(json) { // do stuff});It would be nice if adding the parameter useformat=mobile would get the json object of the mobile page contentlikehttp://en.wikipedia.org/wiki/Main_Page?useformat=mobile&format=jsonbut this link returns a file containing a json object of the page contentRegards,Asher Szmulewicz
2 1
0 0
Results per page:

[8]ページ先頭

©2009-2026 Movatter.jp