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-apiApril 2014

mediawiki-api@lists.wikimedia.org
  • 11 participants
  • 11 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
A question about UPLOAD update
by Liu Chenheng 02 Dec '14

02 Dec '14
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 withUploadWizard" 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 withUploadWizard" 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
4 6
0 0

09 Jun '14
Hi, in response to bug 54607 [1], we've changed the semantics of themobileformat 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 problematicbecause 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 bemobile-friendly", regardless of value. And the output structure willbe the same. For compatibility with older callers,mobileformat=(html|wml) will be special-cased to return the olderstructure at least for 6 month from now. These changes will startbeing rolled out to the WMF sites starting from tomorrow, TuesdayOctober 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=...&mobileformatSame 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]])
2 2
0 0

28 Apr '14
Greetings! I'm back with another question. :)I know that there are several MediaWiki configuration values available inJavaScript through the object mediawiki, and I've made use of mw.config afair bit as necessary. Right now, I want to access the enums fornamespaces, such as NS_MAIN = 0 or NS_TALK = 1, from JavaScript. Are theseexposed anywhere in the mediawiki object?Thanks,--Jason Jijason.y.ji(a)gmail.com
4 5
0 0
Bad or Invalid Token in Extension
by Justin Maldonado 28 Apr '14

28 Apr '14
I'm trying to make a simple extension that moves a page on my mediawikisite, but whether using curl or FauxRequest, I always get bad tokenresponse. Tried urlencoding, not encoding, %2B/, without +/, etc, doesn'tmatter. The token shown in the output looks identical to the one whenrequesting it from the api. I'm a total programming noob, so could besomething simple, but I feel like I've been through everything at thispoint.Code looks like this currently using FauxRequest, with param1/2/3 comingfrom the parser function I'm creating.global $wgUser;$token = $token = $wgUser->editToken(); $params = new FauxRequest( array( 'action' => 'move', 'from' => "$param1", 'to' => "$param2", 'format' => 'php', 'reason' => "$param3", 'token' => "$token"));$api = new ApiMain( $params, true);$api->execute();$data = & $api->getResultData(); $output = "moved $param1 to $param2 - $token";also tried the below code using curl instead, which results in bad token aswellglobal $wgUser;$token = $wgUser->editToken();$url = 'http://www.wikiocity.com/api.php?'; $myvars = 'action=move&format=xml&from=' . "$param1" . '&to=' ."$param2" . '&reason=' . "$param3" . '&token=' . urlencode($token); $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_POST, 1); curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt( $ch, CURLOPT_USERAGENT, 'MyCoolTool/1.1(http://example.com/MyCoolTool/; MyCoolTool(a)example.com)BasedOnSuperLib/1.4'); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec( $ch ); $output = "moved $param1 to $param2 - $myvars - $response";Am I missing something in the code, or could I have a setting wrongsomewhere?Any help would be hugely appreciated!
5 7
0 0
Image uploads auto bot flagged
by Niklas Keller 28 Apr '14

28 Apr '14
Is there a reason why image uploads using the API are automatically flaggedas bot edits?I miss an option do deactivate this behavior.Regards,Niklas Keller
3 4
0 0
MediaWiki API
by mayank desai 18 Apr '14

18 Apr '14
Hello sir,&nbsp;&nbsp; I am mayank desai working on query disambiguation.I am using your mediaWiki API to get articles.How to increase number of pages returned by the API.As its default value is 10 but i want it to increase it.Can you please guide me how to do it?
2 1
0 0

14 Apr '14
Greetings! I am a relatively new MediaWiki extension developer, and I'mhaving trouble with getting the MediaWiki API to capture all links cominginto and out of a given wiki page.I know we can use *action=query&prop=extlinks *to get *external *links fromour wiki page to other (non-wiki) web pages, *action=query&prop=links *toget internal links from our wiki page *out *to other wiki pages, and*action=query&prop=backlinks*to get internal links from other wiki pages *into *our wiki page. However,in the case where a link is *external *but points *to an internal wiki page*,I can't find the proper API call. These links seem to be falling throughthe cracks somehow.I'm inclined to believe that I'm just missing something simple, especiallybecause this MediaWiki help page includes "external links to internalpages" as a category of links:http://www.mediawiki.org/wiki/Help:Links#External_links_to_internal_pagesCan anyone shed light on this issue? Is there an easy way to captureexternal links to internal wiki pages through an API call?Thanks!Sincerely,Jason Ji
2 5
0 0

11 Apr '14
Remember that clients should not be depending on the specific query stringdata returned inside the query-continue or continue nodes. Clients shouldbe treating the returned key-value pairs as opaque data to be returned tothe server with the subsequent query.Interested users may also wish to review the discussion thread from when asimilar change was made last year.[1]To finish fixing bug 24782[2], Gerrit change 103589[3] changes the namesand values of various items under the continue or query-continue node inthe API response. Specifically,* list=allimages will always use aicontinue, rather than sometimes usingaistart. The formatting of the value for the modes that formerly usedaistart will differ from that used by the modes that already usedaicontinue.* list=blocks will now use bkcontinue rather than bkstart.* list=categorymembers will always use cmcontinue, rather than sometimesusing cmstart. The formatting of the value for the modes that formerly usedcmstart will differ from that used by the modes that already usedcmcontinue.* list=deletedrevs will always use drcontinue, rather than sometimes usingdrstart. The formatting of the value for drcontinue is also changing forthe modes that did use it, and the formats differ between modes.* list=logevents will now use lecontinue rather than lestart.* list=protectedtitles will now use ptcontinue rather than ptstart.* list=recentchanges is changing the formatting of the value of rccontinue.* list=usercontribs will always use uccontinue, rather than sometimes usingucstart. The formatting of the value for uccontinue is also changing forthe modes that did use it previously, and the formats differ between modes.* list=watchlist will now use wlcontinue rather than wlstart.These changes should be deployed to WMF wikis with 1.23wmf23, seehttps://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.Also, if anyone is aware of other modules that use a bare timestamp[4] orother non-unique value as their continuation, please reopen bug 24782 (ifthey are in MediaWiki core) or file a new bug (if they are in anextension). Thanks. [1]:http://lists.wikimedia.org/pipermail/mediawiki-api/2013-March/002926.html [2]:https://bugzilla.wikimedia.org/show_bug.cgi?id=24782 [3]:https://gerrit.wikimedia.org/r/#/c/103589/ [4]: Note prop=imageinfo uses a timestamp, but this is OK as in this caseit is apparently a unique identifier.-- Brad Jorsch (Anomie)Software EngineerWikimedia Foundation_______________________________________________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