Hi,
While using the Wikipedia API I noticed an odd behavior. It seems that
I'm only able to retrive the size of a revision in some revisions.
Works fine:
http://en.wikipedia.org/w/api.php?action=query&titles=Porto&prop=revisions&…
Size does not shows up although the call is the same:
http://en.wikipedia.org/w/api.php?action=query&titles=Porto&prop=revisions&…
It seems like a bug. Is it?
I do know if Wikipedia is using the latest version of the Wikimedia API.
Maybe this is already corrected in the development repository.
Btw, size is given in bytes. Correct?
Can you please comment on this issue?
Thanks!
--
Sérgio Nunes
Hi,
I'm trying to use the Mediawiki API to get information about revisions
to a given page. I understand that it is possible to get the entire
contents of a given revision. However I would like to know if it is
possible to only get the diffs introduced in a given revision? This
would result in a reduced bandwidth consumption.
My goal is to get the most frequently used terms in a set of revisions
to a given page. For instance, for the web page Wikipedia what were
the most common terms in all revisions between 2007-09 and 2007-11.
Thanks in advance for any comments on this issue,
--
Sérgio Nunes
Roan,
Using cookies and last version of API modules found using URL
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/,
query is now working fine.
Thanks for your help.
Marion Leclerc
Roan Kattouw <roan.kattouw(a)home.nl>
Sent by: mediawiki-api-bounces(a)lists.wikimedia.org
26/11/2007 15:00
Please respond to MediaWiki API announcements & discussion
To: MediaWiki API announcements & discussion
<mediawiki-api(a)lists.wikimedia.org>
cc:
bcc:
Subject: Re: [Mediawiki-api] Action Query failed due to errorcode
"inpermissiondenied"
marion.leclerc(a)orange-ftgroup.com schreef:
> Then I try to retrieve the token of one page using query action with
> following parameters:
>
<WIKIURL>/api.php?action=query&titles=<PageName>&prop=info&intoken=edit&lgtoken=<LoginToken>&lgusername=<MyLogin>&lguserid=<LoginUserId>
>
>
You used the lg* parameters to stay logged in, which isn't possible any
more due to security concerns. The docs hadn't been updated yet, I did
so upon seeing your e-mail. The correct way to stay logged in is to
fetch the cookies from the action=login request and pass them back to
all subsequent requests. An example of how to do this in PHP using
Snoopy is linked to from the External links section of the login
documentation [1].
Roan Kattouw (Catrope)
[1] http://www.mediawiki.org/wiki/API:Login#External_links
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Hi,
I am trying to update/create articles on our Wiki using the mediawiki API
(using last version found on http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api)
Login phase (action=login) works correctly and returns <LoginToken> and
<LoginUserId> information.
Then I try to retrieve the token of one page using query action with
following parameters:
<WIKIURL>/api.php?action=query&titles=<PageName>&prop=info&intoken=edit&lgtoken=<LoginToken>&lgusername=<MyLogin>&lguserid=<LoginUserId>
Unfortunatelly, I always get the following response (xml format), what
ever the login used (even if user has Sysopt rights):
<?xml version="1.0" encoding="utf-8"?><api><error
code="inpermissiondenied" info="Action 'edit' is not allowed for the
current user" /></api>
I don't understand this error and don't find documentation about it.
Do I need to configure a specific parameter on Wiki to allow "edit" ?
Thanks for your help.
Marion Leclerc
I propose to make same limits (500 on slow and 5000 on fast queries) to
all users for all actions (maybe expect content requests). Reasons:
1. It would be less expensive to fetch 500 (5000) rows on *one query*
than to do *10 times the same query.
2. Usually it's very hard to determine if you may use extended limits
(for now it's group "sysop" (you won't beleive me, but may not exist on
wiki) or "bot" right). I propose to at least add new user right called
"apihighlimits". Anyway, it cause user to do extra query.
--VasilievVV
I noticed that the live wikimedia servers now have a version of the API
that respects the maxlag parameter, which is great. Thanks to the people
who got that working.
The correct action when getting a maxlag error is to sleep for at least
as long as the current lag. A nice feature of the HTTP maxlag error
produced by index.php is that an HTTP header 'Retry-After' that directly
tells how long to wait.
I looked at the API code this afternoon to see if I could add another
field to the error object that would directly include the lag, so that
I don't have to parse it out of the text of the info field. I dicovered
that the error objects at the moment can only have two fields, 'code'
and 'info'.
That explained to me why bug 11404 was resolved the way it was. In that
bug, there was no easy way to distinguish between different sorts of
internal errors without parsing the info field. It was resolved by
changing the error code to directly reflect the type of internal error
encountered.
I don't mind writing a patch to permit different instances of
UsageException to carry extra information in addition to 'code' and
'info', but I don't want to invest the coding time unless other people
think it's worthwhile.
- Carl
Hi,
First off, nice work on the API :-) Nice structure, quite simple to extend.
I'm building an API module for the wikidata extension, which will
basically provide an XML interface to wikidata terms. In doing so I ran
into a couple of issues that I hope somebody on this list can help me with.
My first question is: how do I place an API module in an extension?
Wikidata has it's own branch, so I can simply put my API module and it's
formatters in the includes/api directory and modify both
includes/api/ApiMain.php and includes/AutoLoader.php. But I'd much
rather put my code in the Wikidata extension and not modify anything in
the branch. I found an svn commit that suggests that this is possible,
but I fail to see how.
My second question is: how can a custom printer learn about the format
parameter passed in the request?
My module uses it's own formatter. I created one for several reasons,
one being that I had trouble getting a big data structure into the
ApiResult object. Maybe I just didn't understands the interface. That
wasn't the only reason, I felt like I needed an different internal
representation. Anyway, there's a nice hook for creating a custom
printer: the getCustomPrinter method. But unfortunately that method
doesn't get the value of the format parameter passed in. My module can
format different types of output, but right now I have to solve this by
adding my own format parameter (which gets prefixed with 'wd' for
wikidata). Is there any way I can find out what that parameter was?
Many thanks,
Maarten
--
*Maarten van Hoof*
maarten.vanhoof(a)edia.nl
*Edia* - Educatie Technologie
Asterweg 19D12 | 1031 HL Amsterdam
*T* 020 716 36 12 | *F* 020 716 36 13 | *M* 06 245 392 15 | www.edia.nl
<http://www.edia.nl>
I know there was some discussion about changing the parameter, so maybe this
is just the code being worked out, but the query for backlinks seems to be
broken - even the example on the API help returns nothing.
--
----------------------------
Ian Cabell
RadiantWeb Services
( 877 ) 406 - 6272 [toll free]
ian(a)radiantweb.net
http://www.radiantweb.net
"There is more than one right way .. to make it perfect!"
Hi,
i am new here and I have one question, is there an API client for PHP
available? Maybe stupid, but I need one to communicate (read&write) with
mediawiki from another project, written in php ;-)
Why you dont use SOAP or XML-RPC?
Greetings from Germany
Christian Thiele
--
Freiberuflicher Softwareentwickler
Christian Thiele
August-Bebel-Straße 48
04275 Leipzig
Tel. 0178 4860018