Hi everybody,
i´m trying to export a complete Wikinews article in XML format. I found this feature here: http://en.wikinews.org/wiki/Special:Export This allows you to extract a page in XML, which is already pretty cool, but: this function doesn´t export the related articles which are shown in the infobox on the right. Any idea how to solve this problem? I didn´t found an appropriate function or parameter in the API (http://en.wikinews.org/w/api.php) Perhaps someone could help me, that would be very nice! :)
Thanks in advance :) Sascha
2010/3/17 Sascha Bonnemann sascha.bonnemann@googlemail.com:
Hi everybody,
i´m trying to export a complete Wikinews article in XML format. I found this feature here: http://en.wikinews.org/wiki/Special:Export This allows you to extract a page in XML, which is already pretty cool, but: this function doesn´t export the related articles which are shown in the infobox on the right. Any idea how to solve this problem? I didn´t found an appropriate function or parameter in the API (http://en.wikinews.org/w/api.php) Perhaps someone could help me, that would be very nice! :)
There is an option to export linked pages to a given depth in Special:Export, but this is only enabled for privileged users on Wikipedia right now. You can achieve mostly the same effect using the API with:
http://en.wikinews.org/w/api.php?action=query&generator=links&gplnam...
This'll find the first 50 links on [[Your title here]] pointing to pages in the main namespace and export them.
Roan Kattouw (Catrope)
Hi Roan,
thanks a lot for your quick answer. But it seems like i don´t get it working. When I try this: http://en.wikinews.org/w/api.php?action=query&generator=links&gplnam...
it won´t export any of the links. Where am I wrong?
Sascha Bonnemann
2010/3/17 Roan Kattouw roan.kattouw@gmail.com
2010/3/17 Sascha Bonnemann sascha.bonnemann@googlemail.com:
Hi everybody,
i´m trying to export a complete Wikinews article in XML format. I found
this
feature here: http://en.wikinews.org/wiki/Special:Export This allows you to extract a page in XML, which is already pretty cool,
but:
this function doesn´t export the related articles which are shown in the infobox on the right. Any idea how to solve this problem? I didn´t found an appropriate
function
or parameter in the API (http://en.wikinews.org/w/api.php) Perhaps someone could help me, that would be very nice! :)
There is an option to export linked pages to a given depth in Special:Export, but this is only enabled for privileged users on Wikipedia right now. You can achieve mostly the same effect using the API with:
http://en.wikinews.org/w/api.php?action=query&generator=links&gplnam...
This'll find the first 50 links on [[Your title here]] pointing to pages in the main namespace and export them.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2010/3/17 Sascha Bonnemann sascha.bonnemann@googlemail.com:
Hi Roan,
thanks a lot for your quick answer. But it seems like i don´t get it working. When I try this: http://en.wikinews.org/w/api.php?action=query&generator=links&gplnam...
it won´t export any of the links. Where am I wrong?
You're not doing anything wrong. For some weird reason, http://en.wikinews.org/w/api.php?action=query&generator=links&titles... only reports four links, one of which is in the main namespace ([[UK]]). The links on the right don't show up, but I think they should.
Roan Kattouw (Catrope)
On Wed, Mar 17, 2010 at 10:42 AM, Roan Kattouw roan.kattouw@gmail.com wrote:
2010/3/17 Sascha Bonnemann sascha.bonnemann@googlemail.com:
Hi Roan,
thanks a lot for your quick answer. But it seems like i don´t get it working. When I try this: http://en.wikinews.org/w/api.php?action=query&generator=links&gplnam...
it won´t export any of the links. Where am I wrong?
You're not doing anything wrong. For some weird reason, http://en.wikinews.org/w/api.php?action=query&generator=links&titles... only reports four links, one of which is in the main namespace ([[UK]]). The links on the right don't show up, but I think they should.
I notice that all four links have different namespace targets. Maybe it's only showing one per namespace?
Hi,
The "related news articles" links are generated by DynamicPageList; they aren't in the text or the database. The only way to get them (from the page) is action=render to invoke the extension and then parsing the HTML for the links.
Robert
2010/3/17 Magnus Manske magnusmanske@googlemail.com:
I notice that all four links have different namespace targets. Maybe it's only showing one per namespace?
I did check for that, but that's not it: those really are the only 4 rows in the database. See also Robert's explanation below.
Roan Kattouw (Catrope)
Ah, ok, so i´ve got to deal with this "render-thing" ;)
But render isn´t an action parameter as i see in the api documentation. What did you mean exactly with action=render?
Thanks to everybody for the kindly help. Sascha
2010/3/17 Roan Kattouw roan.kattouw@gmail.com
2010/3/17 Magnus Manske magnusmanske@googlemail.com:
I notice that all four links have different namespace targets. Maybe it's only showing one per namespace?
I did check for that, but that's not it: those really are the only 4 rows in the database. See also Robert's explanation below.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2010/3/17 Sascha Bonnemann sascha.bonnemann@googlemail.com:
Ah, ok, so i´ve got to deal with this "render-thing" ;)
But render isn´t an action parameter as i see in the api documentation. What did you mean exactly with action=render?
It's a parameter to index.php
Roan Kattouw (Catrope)
Hi,
Sorry, should have been more specific. It isn't an API function, it is done with the usual index.php.
You want to do something like:
http://en.wikinews.org/w/index.php?title=UK_government_plans_to_replace_Hous...
which gives simpler HTML than the page generated for browsers. If you look at the source HTML returned you'll see how much easier it is to deal with than the entire GUI page ;-)
Robert
On Wed, Mar 17, 2010 at 6:02 PM, Sascha Bonnemann sascha.bonnemann@googlemail.com wrote:
Ah, ok, so i´ve got to deal with this "render-thing" ;)
But render isn´t an action parameter as i see in the api documentation. What did you mean exactly with action=render?
Thanks to everybody for the kindly help. Sascha
Hi Robert, thanks! :) Ok, the source code created by this render feature is not that enormous as the normal source code ;) So this really seems to be the only chance to get the stuff i want - hm, i hoped there´ll be a solution which exports me everything in XML-format. Looks like i´ve got to parse it by myself.
Thanks to everbody for helping me :)
2010/3/17 Robert Ullmann rlullmann@gmail.com
Hi Sorry, should have been more specific. It isn't an API function, it is done with the usual index.php.
You want to do something like:
http://en.wikinews.org/w/index.php?title=UK_government_plans_to_replace_Hous...
which gives simpler HTML than the page generated for browsers. If you look at the source HTML returned you'll see how much easier it is to deal with than the entire GUI page ;-)
Robert
On Wed, Mar 17, 2010 at 6:02 PM, Sascha Bonnemann sascha.bonnemann@googlemail.com wrote:
Ah, ok, so i´ve got to deal with this "render-thing" ;)
But render isn´t an action parameter as i see in the api documentation. What did you mean exactly with action=render?
Thanks to everybody for the kindly help. Sascha
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org