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

mediawiki-api@lists.wikimedia.org
  • 12 participants
  • 14 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
Weird response from API when using generator
by Christoffer G. Thomsen 28 Jan '14

28 Jan '14
HiI am trying to retrieve the categories of new pages via the API on theDanish Wikipedia using this API request:https://da.wikipedia.org/w/api.php?action=query&prop=categories&format=json…When I make that request, I get this responsehttps://gist.github.com/cgtdk/e746b6042883b970c640(a non-broken up version of the API request URL has been added to thegist as a comment).The interesting part is line 76 to 86. This is the response item for thepage "VM i bandy 2015". It claims that this page only has one category,"Kategori:Fremtidige sportsbegivenheder", but it actually has had threecategories ever since the first (and only, as of writing this) revision:Kategori:Fremtidige sportsbegivenheder, Kategori:VM i bandy, andKategori:Sport i 2015.I have tried to do this several times (with minor modifications) both inthe API Sandbox on dawiki and directly.When I query the page directly, like this:https://da.wikipedia.org/w/api.php?action=query&prop=categories&format=json…I get this response:https://gist.github.com/cgtdk/69e874cf7d3fae6ee506which shows the correct category information for the page.What is going on? Am I doing something wrong or is there a bug?Thanks,Christoffer G. Thomsen (meta:User:Cgtdk)
2 2
0 0

23 Jan '14
Gerrit change 107389[1] adds RevDel support to various API query modules,so for example a user with the 'deletedhistory' right will be able toretrieve the user and summary from prop=revisions.This will cause some changes: - list=deletedrevs, list=filearchive, list=recentchanges, and list=watchlist formerly would not return any information at all for entries where any field was revision-deleted. These entries will now be returned. "hidden" indicators will be provided as is done for modules such as prop=revisions. - prop=imageinfo, list=logevents, prop=revisions, and list=usercontribs will now return field values in addition to the "hidden" indicators, if the user has the necessary user rights. - When "hidden" indicators are returned, a new indicator "suppressed" may also be returned to indicate whether suppression was activated. - prop=imageinfo will now return info for revision-deleted files. - list=logevents, when searching by user or title, will no longer skip revisions where the user or title was revision-deleted if the requesting user has the deletedhistory right. - list=usercontributions will now look at the correct user rights (deletedhistory and suppressrevision, not hideuser) to determine whether to hide revision-deleted contributions.All clients should be updated to expect rows with hidden fields fordeletedrevs, filearchive, recentchanges, and watchlist, and clients withadvanced permissions should be updated to properly handle (and to notpublicly reveal) the data for revision-deleted fields from these modules aswell as imageinfo, logevents, revisions, and usercontribs.These changes will be deployed to WMF wikis with 1.23wmf11, seehttps://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule. [1]:https://gerrit.wikimedia.org/r/#/c/107389/-- 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
2 2
0 0
Random Article
by Max Ilnitskiy 22 Jan '14

22 Jan '14
Hi guys.My name is Max, and i'm iOS developer. I want make "random article" button for iOS. But i don't understand, how does wikipedia random article works. How can i made it? And how can i made random, only in one category? Has article id data about category, or this data are contained in individual properties?ThanksMax Ilnitskiy
2 3
0 0
Hello All, I am Diwanshi Pandey, an OPW intern working on the project"Completing mediawiki API development course on Codecademy" . I havecompleted Parsing and Querying aspects of API but stuck with Modificationsas i don't have required permissions.The link to the course:http://www.codecademy.com/courses/web-intermediate-en-BLea4/4/1I was trying to get an edit token but there was a warning saying:"Unrecognized value for parameter 'intoken': edit"The reason of this issue is certainly because of "callback" parameter.I have also filed a bug as the above warning is unclear.In my course, I want to cover getting a token , editing a page , add a pageto watchlist , etc but not deleting a page.I am blocked by this isuue.Does anybody know some other way to code it? or Can someone guide methrough some other process?Thanks-- *Regards,**Diwanshi Pandey*
2 3
0 0
Re: [Mediawiki-api] How to know the API changes
by Brad Jorsch (Anomie) 15 Jan '14

15 Jan '14
On Tue, Jan 14, 2014 at 5:47 AM, Xia Zhang <xiazhang(a)google.com> wrote:>> From you previous email. You have a QA instance>https://deployment.wikimedia.beta.wmflabs.org/wiki/Main_Page.> I have another question: How frequent you update the QA instance? Is it a> reliable/final QA instance before pushing it to production instance? Or> still involves in some bug-fix-cycle to the QA?>beta.wmflabs.org is updated continuously as changes are merged into the gitrepository.-- Brad Jorsch (Anomie)Software EngineerWikimedia Foundation
3 3
0 0

06 Jan '14
The AssertEdit extension has long been installed on WMF wikis,allowing bots to include "&assert=user" or "&assert=bot" in theiraction=edit requests to prevent accidentally editing while logged out.With Gerrit change 90263,[1] the functionality will be included inMediaWiki core. At the same time, the following changes will be madeto the functioning of this feature:* Assertion will be available on all API actions, not just edit.* Assertion failure will now be indicated by an API error, code'assertbotfailed' or 'assertuserfailed'.* The 'nassert' parameter will be ignored, and using it will give anunrecognized parameter warning.* Other assertions, such as 'true', 'false', and 'exists', will nolonger function and attempting to use them will result in an'unknown_assert' error.Most clients should notice little change from this transition besidesthe fact of receiving an error rather than a failure status fromaction=edit.This change will be rolled out with 1.23wmf10, seehttps://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for theschedule. [1]:https://gerrit.wikimedia.org/r/#/c/90263/-- 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