Movatterモバイル変換


[0]ホーム

URL:


Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
List overview
Download

Mediawiki-apiDecember 2010

mediawiki-api@lists.wikimedia.org
  • 13 participants
  • 8 discussions
Start a nNew thread

20 Jan '26
Hi there,I'm using the API to extract the raw wiki text from my pages, usingthe "?action=query&titles=Main_Page&export&exportnowrap" syntax. Thatworks perfectly.Now I would like to get the templates expanded out in the result, so Iuse: "?action=query&titles=Main_Page&prop=revisions&rvlimit=1&rvprop=content&rvexpandtemplates",which does the job, as expected, but it also strips out the comments.My problem is that the comments are meaningful to me (I use them tohelp process the wiki text in subsequent steps).Is there a way to expand templates with the API, but leave thecomments intact?Thanks,Kevin
4 5
0 0
Need to extract abstract of a wikipedia page
by aditya srinivas 23 Nov '23

23 Nov '23
Hello,I am writing a Java program to extract the abstract of the wikipedia pagegiven the title of the wikipedia page. I have done some research and foundout that the abstract with be in rvsection=0 So for example if I want the abstract of 'Eiffel Tower" wiki page then I amquerying 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 <revxml:space="preserve"> which represents the abstract of the wikipedia page.But this wiki text also contains the infobox data which I do not need. Iwould like to know if there is anyway in which I can remove the infobox dataand get only the wikitext related to the page's abstract Or if there is anyalternative method by which I can get the abstract of the page directly.Looking forward to your help.Thanks in AdvanceAditya Uppu
4 3
0 0
Retrieving images instead of math markup
by Gabriel Sandor 20 Jan '11

20 Jan '11
Hi everyone,Is it possible to retrieve (preferably via the MediaWiki API) an imagerepresenting a mathematical formula given in the <math> tags that arefrequently encountered in Wikipedia articles ? It would be very helpful ifthere were a way to "expand" these tags directly into images, similarly tohow the "templates=expand" string appended to the query string automaticallyexpands most of the templates in an article's wikitext; otherwise, a sectionof the API or of the site (such as a Special page) that can make thisconversion for individual fragments would also be very helpful.Thanks in advance,Gabriel
5 8
0 0

14 Dec '10
Hi everyone,I have a question about two properties you can query about a user account: the "editcount" and the "registration". If you look athttp://en.wikipedia.org/w/api.phpfor the *list=users* method, you see editcount - adds the user's edit count registration - adds the user's registration timestampMy 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 touncover deleted edits and therefore the editcount might exceed the count of edits from *list=usercontribs* )and2) 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:Katr67http://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 athttp://en.wikipedia.org/w/index.php?limit=50&tagfilter=&title=Special:Contr… -- you'll find more than 4edits (contrary to assumption #1) and edits earlier than Dec 10 (contrary to assumption #2). Fromhttp://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 usinghttp://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)
5 7
0 0
action=edit using curl
by Tim McKenna 14 Dec '10

14 Dec '10
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: errorcode="badtoken".<?$qstr=file_get_contents("php://input");$url = "http://localhost:8888/hosted/hum211/api.php?action=edit";$ch = curl_init(); // initialize curl handlecurl_setopt($ch, CURLOPT_URL,$url); // set url to post tocurl_setopt($ch, CURLOPT_FAILONERROR, 1);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirectscurl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variablecurl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4scurl_setopt($ch, CURLOPT_POST, 1); // set POST methodcurl_setopt($ch, CURLOPT_POSTFIELDS, $qstr); // add POST fields$result = curl_exec($ch); // run the whole processcurl_close($ch);echo $result;?>To check I tried sending both not to api.php but to some php that would justdisplay the postfilelds. They look exactly alike.Not sure what to do next.Timothy S. McKennaHumanities teacherParkway Academy of Technology and Health, a Boston Public High School1205 VFW Parkway, Boston, MA 02132 rm404tim(a)sitebuilt.net,http://sitebuilt.netexp. course news on twitter, id: mrtmckennaclass wiki sites:http://pathboston.com/hum3 Humanities 3http://pathboston.com/hum2 Humanities 2(617) 942-0103
4 4
0 0
API bug with page titles with & in them ?
by Nicolas Vervelle 12 Dec '10

12 Dec '10
Hi,I made a few attempts but didn't success to use the API with page titlescontaining a & in them.I tried replacing it with %26 in the request but it seems to work only forsome 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&#039; &amp; Coastin&#039; (InSearch of America)"But, the following request tells that the page is missinghttp://fr.wikipedia.org/w/api.php?rvprop=content|ids|timestamp&inprop=prote…'%26 Coastin' (In Search of America)The requests says that page "Rollin&#039; &amp; Coastin&#039; (In Search ofAmerica)" is missingAm I missing something or is there a bug in the API ?Thanks,Nico
4 4
0 0

10 Dec '10
chrome-extension://dbdhjalplldajenkfbobbommodgnanjo/options.html
1 0
0 0
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 onrcid; instead, they are the same throughout the session (like the edittoken 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 neverdeployed to Wikimedia wikis.Roan Kattouw (Catrope)_______________________________________________Mediawiki-api-announce mailing listMediawiki-api-announce(a)lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce
1 0
0 0
Results per page:

[8]ページ先頭

©2009-2026 Movatter.jp