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, All,
I found in some of the UPLOAD update, there is no page id:
<rc type="log" ns="6" title="File:Lucian A. Sperta- Nunez.jpg" rcid="
114549183" pageid="0" revid="0" old_revid="0" user="Azarel63"oldlen="0"
newlen="0" timestamp="2014-01-05T11:09:38Z" comment="User created page with
UploadWizard" logid="77242320" logtype="upload"logaction="upload" img_sha1="
sf9t03wg27tl73nnde3jzfuxncefux9" img_timestamp="2014-01-05T11:09:36Z"/>
<rc type="log" ns="6" title="File:Gingerbread spices (annotated).jpg" rcid="
114549185" pageid="30485540" revid="0" old_revid="0"user="SKopp" oldlen="0"
newlen="0" timestamp="2014-01-05T11:09:37Z" comment="User created page with
UploadWizard" logid="77242318"logtype="upload" logaction="upload" img_sha1="
q84abqjr2n4bmn7o6j4uovpl5ufs2gq" img_timestamp="2014-01-05T11:09:37Z"/>
The first one has no page id but the second one has.
Does anybody can tell me the differences?
Thanks,
Ethan Liu
The "protorel" property recently added to the output of
action=query&meta=siteinfo&siprop=interwikimap was coded to include the
property with a boolean true value rather than the API-standard empty
string. This is now corrected, and will be deployed to WMF wikis with
1.24wmf10.
At some point in the future (timeframe and details undecided yet), I would
like to change the API so that boolean properties like this one will
actually be a truthy value (e.g. boolean true) in JSON and other output
formats. It's likely that the backwards-compatible mode would cause any
other properties that are currently returning as boolean true to change to
empty-string.
--
Brad Jorsch (Anomie)
Software Engineer
Wikimedia Foundation
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
Hi, in response to bug 54607 [1], we've changed the semantics of the
mobileformat parameter to action=parse
== Summary ==
Previously, it used to accept strings 'html' or 'wml', later just
'html' and modify the structure of output (see below). This was problematic
because you needed to retrieve the HTML from output in different ways,
depending on whether mobileformat is specified or not. Now,
mobileformat is a boolean parameter, that is if there's a 'mobileformat'
parameter in request, it will be treated as "the output should be
mobile-friendly", regardless of value. And the output structure will
be the same. For compatibility with older callers,
mobileformat=(html|wml) will be special-cased to return the older
structure at least for 6 month from now. These changes will start
being rolled out to the WMF sites starting from tomorrow, Tuesday
October 24th and this process will be complete by October 31st.
== Examples ==
=== Non-mobile parse ===
api.php?action=parse&format=xml
{
"parse": {
"title": "...",
"text": {
"*": "foo"
}
}
}
api.php?action=parse&format=json
<?xml version="1.0"?>
<api>
<parse title="..." displaytitle="...">
<text xml:space="preserve">foo</text>
</parse>
</api>
=== Parse that outputs mobile HTML, old style ===
api.php?action=parse&format=json&mobileformat=html
{
"parse": {
"title": "API",
"text": "foo"
}
}
api.php?action=parse&format=xml&mobileformat=html
<?xml version="1.0"?>
<api>
<parse title="..." text="foo" displaytitle="...">
</parse>
</api>
=== Parse that outputs mobile HTML, new style ===
api.php?action=parse&format=...&mobileformat
Same as for non-mobile parses.
== FAQ ==
Q: I didn't use mobileformat before, does anything change for me?
A: No.
Q: I use mobileformat=html, will my bot/tool be broken now?
A: No, you will have 6 months to switch to new style.
Q: I'm only planning to use mobileformat, what should I do?
A: Just use the new style.
Q: How did this format discrepancy appear in the first place?
A: To err is human.
-----
[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=54607
--
Best regards,
Max Semenik ([[User:MaxSem]])
With Gerrit change 136799 <https://gerrit.wikimedia.org/r/#/c/136799/>, the
old output format for action=expandtemplates and the generatexml parameter
are deprecated, but will continue to be used for existing queries.
Clients should begin using the new 'prop' parameter to
action=expandtemplates, to be ready for some future date when the
deprecated format and parameter are removed. There is no timeline on this
removal, but it will be announced well in advance to this list.
This change will be deployed to WMF wikis with 1.24wmf8, see
https://www.mediawiki.org/wiki/MediaWiki_1.24/Roadmap for the schedule.
This is not considered a breaking change, since the old queries will
continue to work with a deprecation warning.
--
Brad Jorsch (Anomie)
Software Engineer
Wikimedia Foundation
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
Hello everyone,
I'm about 2 weeks into my OPW internship, in which I'll be evaluating
MediaWiki API client libraries in five languages against a standard
I've written and then contributing in depth to one of them.[1] By now
I have a handle on using the API and the available client libraries
and I've written the standard I'll be using to evaluate these
libraries.[2]
Off-wiki, I've started writing a series of posts on getting acquainted
with the API[3]. A few days ago I spoke at WikiConference USA on the
basics of APIs and API usage--slides are up on Commons, linked to from
my conference run-down.[4]
If you have any comments on the standard, please leave them on the
talk page or grab me in IRC (fhocutt).
-Frances
[1] https://www.mediawiki.org/wiki/Evaluating_and_Improving_MediaWiki_web_API_c…
[2] https://www.mediawiki.org/wiki/API:Client_code/Gold_standard
[3] http://franceshocutt.com/tag/api/
[4] http://franceshocutt.com/2014/06/02/wikiconference-usa-2014-rundown/