Hi everyone,
Is it possible to retrieve (preferably via the MediaWiki API) an image
representing a mathematical formula given in the <math> tags that are
frequently encountered in Wikipedia articles ? It would be very helpful if
there were a way to "expand" these tags directly into images, similarly to
how the "templates=expand" string appended to the query string automatically
expands most of the templates in an article's wikitext; otherwise, a section
of the API or of the site (such as a Special page) that can make this
conversion for individual fragments would also be very helpful.
Thanks in advance,
Gabriel
Hi everyone,
I have a question about two properties you can query about a user
account: the "editcount" and the "registration". If you look at
http://en.wikipedia.org/w/api.php
for the *list=users* method, you see
editcount - adds the user's edit count
registration - adds the user's registration timestamp
My naive interpretation is that editcount is the total number of edits
made a given user (including the number of and registration is the time
when the account was setup.) Therefore,
if you use *list=usercontribs* method, two things should be true:
1) the editcount should be greater to or equal to the number of edits
(usercontribs) for the given user I can get from the API. (As an
ordinary user of the API, I won't be able to
uncover deleted edits and therefore the editcount might exceed the count
of edits from *list=usercontribs* )
and
2) the timestamp of all edits for a given user account cannot be earlier
than the registration timestamp for that account. (That is, how can an
account be editing before the account was actually registered.)
In computing statistics for many recent accounts, I have these
assumptions to be true for the vast majority of accounts. I'm puzzled,
however, for accounts in which one or both assumptions are wrong. An
example is User:Katr67
http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Katr67&us…
yields:
<?xml version="1.0"?>
<api>
<query>
<users>
<user name="Katr67" editcount="4" registration="2010-12-10T08:09:19Z" />
</users>
</query>
</api>
But if you look at the list of contributions by User:Katr67 at
http://en.wikipedia.org/w/index.php?limit=50&tagfilter=&title=Special:Contr…
-- you'll find more than 4
edits (contrary to assumption #1) and edits earlier than Dec 10
(contrary to assumption #2). From
http://toolserver.org/~soxred93/pcount/index.php?name=Katr67&lang=en&wiki=w…
we can see that there are 504 edits attributed to User:Katr67 (something
one can verify through using
http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Katr67&us…
or mwclient -- e.g.:
len(list(mwclient.Site("en.wikipedia.org").usercontributions(user="Katr67")))
(which returned 504)
So, what do *editcount* and *registration* really mean then? (For
User:Katr67, it looks like there was some change to the account on Dec
10, which reset the registration timestamp and editcount to the last 4
edits. )
Thanks,
-Raymond (User:RaymondYee)
When I post from a form I have no trouble having action=edit work.
But when I send the same $postdata through a curl script I get: error
code="badtoken".
<?
$qstr=file_get_contents("php://input");
$url = "http://localhost:8888/hosted/hum211/api.php?action=edit";
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, $qstr); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
echo $result;
?>
To check I tried sending both not to api.php but to some php that would just
display the postfilelds. They look exactly alike.
Not sure what to do next.
Timothy S. McKenna
Humanities teacher
Parkway Academy of Technology and Health, a Boston Public High School
1205 VFW Parkway, Boston, MA 02132 rm404
tim(a)sitebuilt.net, http://sitebuilt.net
exp. course news on twitter, id: mrtmckenna
class wiki sites:
http://pathboston.com/hum3 Humanities 3
http://pathboston.com/hum2 Humanities 2
(617) 942-0103
Hi,
I made a few attempts but didn't success to use the API with page titles
containing a & in them.
I tried replacing it with %26 in the request but it seems to work only for
some requests...
For example, the following request seems to work:
http://en.wikipedia.org/w/api.php?action=query&titles=Rollin' %26 Coastin'
(In Search of America)&prop=info&inprop=protection|talkid<http://en.wikipedia.org/w/api.php?action=query&titles=Rollin'%20%26%20Coastin'%20(In%20Search%20of%20America)&prop=info&inprop=protection|talkid>
I get the informations about page "Rollin' & Coastin' (In
Search of America)"
But, the following request tells that the page is missing
http://fr.wikipedia.org/w/api.php?rvprop=content|ids|timestamp&inprop=prote…'
%26 Coastin' (In Search of America)
The requests says that page "Rollin' & Coastin' (In Search of
America)" is missing
Am I missing something or is there a bug in the API ?
Thanks,
Nico
2010/10/23 Roan Kattouw <roan.kattouw(a)gmail.com>:
> As of r75274, patrol tokens accepted by action=patrol and generated by
> list=recentchanges are no longer equal to edit tokens and are no
> longer the same within a session. Instead, they are now different for
> every recentchanges row (i.e. they depend on the rcid).
>
> It may take a while for this change to be deployed to the Wikimedia
> cluster, but in the meantime changing your clients to no longer depend
> on the patrol token to stay the same can't hurt.
>
This has changed again in r78141. Patrol tokens no longer depend on
rcid; instead, they are the same throughout the session (like the edit
token is), but NOT equal to the edit token. Also,
api.php?action=patrol now only accepts POST requests.
The changes in r75274 were never part of any release and were never
deployed to Wikimedia wikis.
Roan Kattouw (Catrope)
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce