Hello,
I am writing a Java program to extract the abstract of the wikipedia page
given the title of the wikipedia page. I have done some research and found
out that the abstract with be in rvsection=0
So for example if I want the abstract of 'Eiffel Tower" wiki page then I am
querying 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 <rev
xml:space="preserve"> which represents the abstract of the wikipedia page.
But this wiki text also contains the infobox data which I do not need. I
would like to know if there is anyway in which I can remove the infobox data
and get only the wikitext related to the page's abstract Or if there is any
alternative method by which I can get the abstract of the page directly.
Looking forward to your help.
Thanks in Advance
Aditya Uppu
Hi,
I'm creating a .Net library to access the API, but I'm not sure how to
approach selecting what properties should the result have.
For example, when the user wants to access “info” of some page, I want
to offer him all the available properties. And if he selects “length”
and “fullurl”, I should form URL like
http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Main%20Page…
The “length” property is included by default, and “fullurl” is added
by “inprop=url”.
I can get most other information about the structure of the API by
using “action=paraminfo”, but information about what result properties
are available and how they correspond to the prop values seems to be
missing.
Is this information available somewhere? Is trying the query and
seeing what properties are returned the best I can do currently? Do
you 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]]
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
Hi, I have a question about the functionality of the API on zh.wikipedia.org
:
It appears that the API isn't performing redirects that involve conversion
of certain simplified Chinese page titles to traditional, but these
redirects _are_ supported by the wiki's frontend. For example:
When I enter http://zh.wikipedia.org/wiki/���ŷɼ� into my browser, this
redirects automatically to http://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), I
get no results.
Other simplified to traditional redirects do work in both the frontend and
the API. For example both http://zh.wikipedia.org/wiki/�й�andhttp://zh.wikipedia.org/wiki/�Ї� lead to the same page. I do notice that
here, unlike in my previous example, the request for the simplified title
shows 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 language
forum I should address this question to?
Many thanks,
Joel
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 content
like http://en.wikipedia.org/wiki/Main_Page?useformat=mobile&format=json
but this link returns a file containing a json object of the page content
Regards,
Asher Szmulewicz