________________________________
hi, Sorry, I've been through the documentation, but I can't seem to find a method to return a rendered section of a page. I see the methods for editing a section, but not obtaining it.
Any help would be greatly appreciated. Many apologies if this is a really basic question I'm too dim to figure out.
Thanks very much Don
2010/5/11 don undeen donundeen@yahoo.com:
hi, Sorry, I've been through the documentation, but I can't seem to find a method to return a rendered section of a page. I see the methods for editing a section, but not obtaining it.
Any help would be greatly appreciated. Many apologies if this is a really basic question I'm too dim to figure out.
This functionality was implemented very, very recently (yesterday, to be exact), so it'll take some time for it to be available on Wikimedia wikis.
Roan Kattouw (Catrope)
ah, so it's implemented in the core code? I'm doing this work on my own wikis, so I can update my own wikis codebase to support this, perhaps. what version of MW is this implemented on?
barring that approach, I saw some references to obtaining an xml rendering of an entire page. Is that right? If I could get an xml representation of a rendered page, where each section is noted in the xml somehow, I could then extract the relevent section, with just the additional overhead of pulling the whole page.
However, my efforts to specify the generatexml parameter failed.
Any hints?
Thanks again for your quick response!
________________________________ From: Roan Kattouw roan.kattouw@gmail.com To: MediaWiki API announcements & discussion mediawiki-api@lists.wikimedia.org Sent: Tue, May 11, 2010 2:56:27 PM Subject: Re: [Mediawiki-api] API to get just a section of a page
2010/5/11 don undeen donundeen@yahoo.com:
hi, Sorry, I've been through the documentation, but I can't seem to find a method to return a rendered section of a page. I see the methods for editing a section, but not obtaining it.
Any help would be greatly appreciated. Many apologies if this is a really basic question I'm too dim to figure out.
This functionality was implemented very, very recently (yesterday, to be exact), so it'll take some time for it to be available on Wikimedia wikis.
Roan Kattouw (Catrope)
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2010/5/11 don undeen donundeen@yahoo.com:
ah, so it's implemented in the core code? I'm doing this work on my own wikis, so I can update my own wikis codebase to support this, perhaps. what version of MW is this implemented on?
Only on the trunk SVN version so far.
barring that approach, I saw some references to obtaining an xml rendering of an entire page. Is that right? If I could get an xml representation of a rendered page, where each section is noted in the xml somehow, I could then extract the relevent section, with just the additional overhead of pulling the whole page.
However, my efforts to specify the generatexml parameter failed.
You can work around this by grabbing the raw wikitext of the section using action=query&prop=revisions&rvprop=content&rvsection=3 , then passing the resulting wikitext to action=parse&text=WikitextHere . In trunk, action=parse has a section parameter than can be used in conjunction with the page parameter to cut out the middle man.
Roan Kattouw (Catrope)
hm, I tried this: http://ddig8109/wiki/api.php?action=query&titles=Don_Playground%E2%88%9D...
(for page name :'Don Playground')
but it returns all of the page, not just section 1.
oh and when I added call a url like: http://ddig8109/wiki/api.php?version=
I get this version info:
Version: MediaWiki 1.12.0rc1 ApiMain: $Id: ApiMain.php 31484 2008-03-03 05:46:20Z brion $ http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/ApiMain.... ApiBase: $Id: ApiBase.php 31259 2008-02-25 14:14:55Z catrope $ http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/ApiBase.... ApiFormatBase: $Id: ApiFormatBase.php 30222 2008-01-28 19:05:26Z catrope $ http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/ApiForma... ApiQueryBase: $Id: ApiQueryBase.php 31484 2008-03-03 05:46:20Z brion $ http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/ApiQuery... ApiFormatFeedWrapper: $Id: ApiFormatBase.php 30222 2008-01-28 19:05:26Z catrope $ http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/ApiForma...
and hm, in that page, which is the auto-generated API doc, there's no mention of any "rvsection" parameter. So maybe I'm just using a too-old version?
________________________________ From: Roan Kattouw roan.kattouw@gmail.com To: MediaWiki API announcements & discussion mediawiki-api@lists.wikimedia.org Sent: Tue, May 11, 2010 3:05:19 PM Subject: Re: [Mediawiki-api] API to get just a section of a page
2010/5/11 don undeen donundeen@yahoo.com:
ah, so it's implemented in the core code? I'm doing this work on my own wikis, so I can update my own wikis codebase to support this, perhaps. what version of MW is this implemented on?
Only on the trunk SVN version so far.
barring that approach, I saw some references to obtaining an xml rendering of an entire page. Is that right? If I could get an xml representation of a rendered page, where each section is noted in the xml somehow, I could then extract the relevent section, with just the additional overhead of pulling the whole page.
However, my efforts to specify the generatexml parameter failed.
You can work around this by grabbing the raw wikitext of the section using action=query&prop=revisions&rvprop=content&rvsection=3 , then passing the resulting wikitext to action=parse&text=WikitextHere . In trunk, action=parse has a section parameter than can be used in conjunction with the page parameter to cut out the middle man.
Roan Kattouw (Catrope)
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2010/5/11 don undeen donundeen@yahoo.com:
hm, I tried this: http://ddig8109/wiki/api.php?action=query&titles=Don_Playground%E2%88%9D...
(for page name :'Don Playground')
but it returns all of the page, not just section 1.
oh and when I added call a url like: http://ddig8109/wiki/api.php?version=
I get this version info:
Version: MediaWiki 1.12.0rc1 ApiMain: $Id: ApiMain.php 31484 2008-03-03 05:46:20Z brion $
That's... quite old. The latest version of MW is 1.15. 1.12 is about two years old, as evidenced by the timestamps in the version output.
Roan Kattouw (Catrope)
yikes, looks like it's time for an upgrade!
________________________________ From: Roan Kattouw roan.kattouw@gmail.com To: MediaWiki API announcements & discussion mediawiki-api@lists.wikimedia.org Sent: Tue, May 11, 2010 3:15:39 PM Subject: Re: [Mediawiki-api] API to get just a section of a page
2010/5/11 don undeen donundeen@yahoo.com:
hm, I tried this: http://ddig8109/wiki/api.php?action=query&titles=Don_Playground%E2%88%9D...
(for page name :'Don Playground')
but it returns all of the page, not just section 1.
oh and when I added call a url like: http://ddig8109/wiki/api.php?version=
I get this version info:
Version: MediaWiki 1.12.0rc1 ApiMain: $Id: ApiMain.php 31484 2008-03-03 05:46:20Z brion $
That's... quite old. The latest version of MW is 1.15. 1.12 is about two years old, as evidenced by the timestamps in the version output.
Roan Kattouw (Catrope)
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Are going to be implemented API selective getting for usual sections or for labelled sections too? I LOVE #lst extension.... but I see that this extremely powerful tool is almost only used into source projects, it's a pity IMO. #lst extension can turn a wiki page into a "mapping object" similar to a python dictionary...
Nevertheless, it's pretty simple to get labelled sections from a raw page by a little bit of python code, usual section parsing could more tricky.
-- Alex
2010/5/12 Alex Brollo alex.brollo@gmail.com:
Are going to be implemented API selective getting for usual sections or for labelled sections too? I LOVE #lst extension.... but I see that this extremely powerful tool is almost only used into source projects, it's a pity IMO. #lst extension can turn a wiki page into a "mapping object" similar to a python dictionary...
Nevertheless, it's pretty simple to get labelled sections from a raw page by a little bit of python code, usual section parsing could more tricky.
No, it only operates on section numbers, like all the other API modules operating on sections. You can still grab a section by its name by grabbing the section tree from action=parse&prop=sections&page=Page_name , and extracting the section number from that tree.
Roan Kattouw (Catrope)
No, it only operates on section numbers, like all the other API
modules operating on sections. You can still grab a section by its name by grabbing the section tree from action=parse&prop=sections&page=Page_name , and extracting the section number from that tree.
Roan Kattouw (Catrope)
I guess it's simpler to extract a labelled section with a substring search into the whole raw content. ;-) Thanks Roan.
Alex
mediawiki-api@lists.wikimedia.org