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
When list=allusers is used with auactiveusers, a property 'recenteditcount'
is returned in the result. In bug 67301[1] it was pointed out that this
property is including various other logged actions, and so should really be
named something like "recentactions".
Gerrit change 130093,[2] merged today, adds the "recentactions" result
property. "recenteditcount" is also returned for backwards compatability,
but will be removed at some point during the MediaWiki 1.25 development
cycle.
Any clients using this property should be updated to use the new property
name. The new property will be available on WMF wikis with 1.24wmf12, see
https://www.mediawiki.org/wiki/MediaWiki_1.24/Roadmap for the schedule.
[1]: https://bugzilla.wikimedia.org/show_bug.cgi?id=67301
[2]: https://gerrit.wikimedia.org/r/#/c/130093/
--
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, 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
Hi all,
When I wrote the new API client library standard, one of the intended
effects was that libraries would make it easy for bot-runners to
comply with the user-agent policy found at
https://meta.wikimedia.org/wiki/User-agent_policy . However, different
people understand the policy to mean different things.
As I read it, the relevant parts of the policy are:
"If you run a bot, please send a User-Agent header identifying the bot
and supplying some way of contacting you, e.g.:
`User-Agent: MyCoolTool/1.1 (http://example.com/MyCoolTool/;
MyCoolTool(a)example.com) BasedOnSuperLib/1.4`"
There's been some discussion in the context of my client library
evaluation project here:
https://www.mediawiki.org/wiki/API_talk:Client_code/Evaluations/Java_Wiki_B…
and here: https://github.com/jpatokal/mediawiki-gateway/issues/65 . As
I understood it, the example provided demonstrated the requirements,
but it's now clear to me that there's room for ambiguity in the
interpretation of the user-agent policy.
My question is: what information is essential to "identify" a bot? The
example given appears to contain the bot name and version, a link to a
page with more information and/or the repository for the bot's code,
and the framework that was used to write the bot (SuperLib/1.4, I
assume). Does WMF operations want all of these components? What is the
minimum necessary to comply with the policy, and what is bonus
information?
-Frances
I'm working on a bot <https://github.com/Inclumedia/MirrorBot> that will
gather all data, including revision IDs, as they are made available via the
MediaWiki API, by polling list=recentchanges. To make it easier, I'm
developing core patches to make more data available via the API. See, e.g.,
bug 68950 <https://bugzilla.wikimedia.org/show_bug.cgi?id=68950>,
"log_params should contain the revision IDs of null revisions created by
page move events". I don't know why anyone else but me, or someone working
on a similar project, would need this feature, but being able to access
that data via log_params makes it so I don't have to do a separate
prop=revisions query.
I was wondering, how do the +2's decide what API features are useful enough
to enough people to be worth reviewing and merging? Are they more likely to
ask "why" or "why not" when a new API feature is proposed? Are there any
developers in particular who'd be interested in reviewing new API features
for obscure use cases? Thanks.
--
Nathan
RFC 2616[1] 14.43 suggests the user agent field should identify using product tokens ("product"/"version_or_comment") and sub products by convention from most significant to least. This might be a useful model based on the discussions?
botname/version [user:botusername/wiki.domain.tld] [task:task name/url] [product/version_or_comment] [...]
Amgine
[1] https://www.ietf.org/rfc/rfc2616.txt
Hello all,
I'm about 3/4 done with my OPW internship project.[1] I have finished
evaluating the libraries I intended to, contacting the maintainers,
and filing bug reports/enhancement requests.
The evaluations are here.[2] Check them out, add to them, comment on
the talk pages, and start evaluating some client libraries yourself if
you are so inclined! A couple of people contacted me about evaluating
the available PHP libraries. While that's not in the scope of my
project, feel free to ask me any questions if you're interested in
taking that on.
-Frances
[1] https://www.mediawiki.org/wiki/Evaluating_and_Improving_MediaWiki_web_API_c…
[2] https://www.mediawiki.org/wiki/API:Client_code/Evaluations
Hi all,
I found that in the "Delete/Restore Page/Revision" recent change updates,
not all of them have page id, sometimes the page id equals to 0. Is it
expected or just a bug? If it's expected, can you tell me that what kind of
operations will cause the "0 page id" update?
For example:
*page id = 0:*
<rc type="log" ns="0" title="CHE-YOUTH ORGANISATION" rcid="603071797"
pageid="0" revid="0" old_revid="0" user="Alexf" oldlen="0" newlen="0"
timestamp="2013-09-17T15:39:14Z" comment="Multiple reasons: speedy deletion
criteria [[WP:A7|A7]], [[WP:G11|G11]]" logid="51077039" logtype="delete"
logaction="delete"/>
*page id != 0:*
RESTORE PAGE
<rc type="log" ns="0" title="Willans" pageid="43303661" revid="0"
old_revid="0" rcid="668919167" user="Anthony Appleyard" oldlen="0"
newlen="0" timestamp="2014-07-15T05:10:23Z" comment="7 revisions restored"
logid="57582944" logtype="delete" logaction="restore"/>
DELETE PAGE
<rc type="log" ns="0" title="Waterline Plumbing" pageid="43303560"
revid="0" old_revid="0" rcid="668917805" user="MER-C" oldlen="0" newlen="0"
timestamp="2014-07-15T04:54:05Z" comment="[[WP:CSD#G11|G11]]: Unambiguous
[[WP:NOTADVERTISING|advertising]] or promotion" logid="57582772"
logtype="delete" logaction="delete"/>
DELETE REVISION
<rc type="log" ns="0" title="Sywell Aerodrome" pageid="43516" revid="0"
old_revid="0" rcid="668896726" user="Mike V" oldlen="0" newlen="0"
timestamp="2014-07-15T00:55:22Z" comment="[[WP:RD1|RD1]]: Blatant copyright
violations" logid="57579965" logtype="delete" logaction="revision">
<param>revision</param>
<param>615401409,615401374,615401262,615401089</param>
<param>ofield=0</param>
<param>nfield=1</param>
</rc>
Thanks,
Ethan Liu
(also posted on Mediawiki.org on API talk:Login [1])
Hi,
My application, WPCleaner [2] works fine on Wikimedia wikis (Wikipedia,
Wiktionary, ...), but my attempts to make it work on Waze wiki [3] have
failed for now. I don't understand why login doesn't work on Waze wiki.
Would someone have an idea about this problem ?
The first call to the login method for waze wiki returns a "NeedToken"
answer as usual, with a session id in the answer and a wikidb_session
cookie. When I call the login method a second time, with wikidb_session
cookie set and the token, the answer from waze wiki is again a "NeedToken"
with a different session id and wiki_session cookie.
Apart from this, the only difference that I noticed is the cookie name:
enwikiSession for enwiki, wikidb_session for waze (no uppercase letter and
an underscore).
Here's what my logs are saying when calling enwiki login:
POST
https://en.wikipedia.org/w/api.php?action=login&lgname=NicoVTest&format=xml
Request header:Accept-Encoding: gzip
Request header:User-Agent: WPCleaner (+
http://en.wikipedia.org/wiki/User:NicoV/Wikipedia_Cleaner/Documentation)
Request header:Host: en.wikipedia.org
Request header:Content-Length: 60
Request header:Content-Type: application/x-www-form-urlencoded
Response header:Server: nginx/1.1.19
Response header:Date: Fri, 11 Jul 2014 21:58:05 GMT
Response header:Content-Type: text/xml; charset=utf-8
Response header:Content-Length: 159
Response header:Connection: keep-alive
Response header:X-Content-Type-Options: nosniff
Response header:Cache-control: private
Response header:Set-Cookie: enwikiSession=XXXXXX; path=/; secure; HttpOnly
Response header:X-Frame-Options: SAMEORIGIN
Response header:Content-Encoding: gzip
Response header:Vary: Accept-Encoding
Response header:X-Varnish: 2249630267, 3978847279, 3259701709
Response header:Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
Response header:Accept-Ranges: bytes
Response header:Age: 0
Response header:X-Cache: cp1068 miss (0), amssq53 miss (0), amssq43
frontend miss (0)
Response header:Set-Cookie: GeoIP=XXXXXX; Path=/; Domain=.wikipedia.org
POST
https://en.wikipedia.org/w/api.php?action=login&lgname=NicoVTest&format=xml
Request header:Accept-Encoding: gzip
Request header:User-Agent: WPCleaner (+
http://en.wikipedia.org/wiki/User:NicoV/Wikipedia_Cleaner/Documentation)
Request header:Host: en.wikipedia.org
Request header:Cookie: $Version=0; enwikiSession=XXXXXX; $Path=/
Request header:Cookie: $Version=0; GeoIP=FR:Clamart:48.8000:2.2667:v4;
$Path=/; $Domain=.wikipedia.org
Request header:Cookie2: $Version="1"
Request header:Content-Length: 101
Request header:Content-Type: application/x-www-form-urlencoded
Responses headers...
And the logs when calling waze wiki login:
POST
https://wiki.waze.com/wiki/api.php?action=login&lgname=NicoVTest&format=xml
Request header:Accept-Encoding: gzip
Request header:User-Agent: WPCleaner (+
http://en.wikipedia.org/wiki/User:NicoV/Wikipedia_Cleaner/Documentation)
Request header:Host: wiki.waze.com
Request header:Content-Length: 62
Request header:Content-Type: application/x-www-form-urlencoded
Response header:Cache-Control: private
Response header:Cache-control: no-cache="set-cookie"
Response header:Content-Encoding: gzip
Response header:Content-Type: text/xml; charset=utf-8
Response header:Date: Fri, 11 Jul 2014 22:00:55 GMT
Response header:Server: nginx/1.1.19
Response header:Set-Cookie: wikidb_session=XXXXXX; path=/; secure; HttpOnly
Response header:Set-Cookie:
AWSELB=191167A308A57C43B5D163A49A25B6EA216AC961ACDACCD786A7F86CF60CB7DDA816851FC0DC6FA0FA203C21DE3B646E62AAF326EE53AE742952C05529425567AFC89D9424;PATH=/
Response header:Vary: Accept-Encoding
Response header:X-Content-Type-Options: nosniff
Response header:X-Frame-Options: DENY
Response header:Content-Length: 166
Response header:Connection: keep-alive
POST
https://wiki.waze.com/wiki/api.php?action=login&lgname=NicoVTest&format=xml
Request header:Accept-Encoding: gzip
Request header:User-Agent: WPCleaner (+
http://en.wikipedia.org/wiki/User:NicoV/Wikipedia_Cleaner/Documentation)
Request header:Host: wiki.waze.com
Request header:Cookie: $Version=0; wikidb_session=XXXXXX; $Path=/
Request header:Cookie: $Version=0;
AWSELB=191167A308A57C43B5D163A49A25B6EA216AC961ACDACCD786A7F86CF60CB7DDA816851FC0DC6FA0FA203C21DE3B646E62AAF326EE53AE742952C05529425567AFC89D9424;
$Path=/
Request header:Cookie2: $Version="1"
Request header:Content-Length: 103
Request header:Content-Type: application/x-www-form-urlencoded
Responses headers...
Any idea on what's going on?
Thanks in advance
Nico
[1] https://en.wikipedia.org/wiki/Wikipedia:WPCleaner
[2] https://www.mediawiki.org/wiki/API_talk:Login
[3] https://wiki.waze.com/