rh00667 | 8 Dec 2009 21:25
Picon

FELIZ NAVIDAD y ANIO NUEVO 2010!!! / MERRY XMAS & HAPPY NEW YEAR!!!

queridos TODOS!

les pido que me perdonen por la falta de contacto email/telf. 
he estado muy complicado y espero hacerlo pronto ...

deseo que Dios los bendiga a TODOS y les conceda mucha salud, 
paz, amor y felicidad. que pasen unos bellos dias en union 
de sus seres queridos y que el nuevo anio sea un poco mejor 
para toda humanidad.

un sincero abrazo!
FELICIDADES!!!!

roberto
======================================================================

dear ALL!

excuse me not contact by email/phone. 
i was very busy and i hope to do that at return ...

please receive my best wishes of health, peace, 
love and happynest in XMAS and a nice NEW YEAR!

sincerey yours!!!!!!

roberto
_______________________________________________
(Continue reading)

Skiiiks | 12 Dec 2009 21:49
Picon

Random article of a category

Hi:

I have been using the API (http://en.wikipedia.org/w/api.php) and found some problem. I would like to get a random article of a category or child categories. I mean if I need a random article of "Science" category, so the result can be an article in "Astronomy" category, or "Biology" category.

"random" command just have namespace not category, and "categorymembers" has not recursivity.
The problems is categories are not nested so I guess there's no command that give that recursivity since an article has just "parent categories" and not all the jerarchy information.

I have tried to mix "random" and "categorymembers" with generators:
http://en.wikipedia.org/w/api.php?action=query&list=random&generator=categorymembers&gcmtitle=Category:Physics&prop=info
http://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&generator=random&rnnamespace=0

... but no luck

The only solution i'm thinking is to code some random depth search in the category I want to get the random article, and then search in that category any random article. So, I can use "categorymembers" command to deep a random number of levels, and then take the article there.

Is there any nice solution ?

Thank you
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Bryan Tong Minh | 12 Dec 2009 21:54
Picon
Gravatar

Re: Random article of a category

On Sat, Dec 12, 2009 at 9:49 PM, Skiiiks <skiiiks <at> gmail.com> wrote:
>
> The only solution i'm thinking is to code some random depth search in the
> category I want to get the random article, and then search in that category
> any random article. So, I can use "categorymembers" command to deep a random
> number of levels, and then take the article there.
>
> Is there any nice solution ?
>
No. The solution you mentioned is the only one.

Bryan
Skiiiks | 12 Dec 2009 22:23
Picon

Re: Random article of a category

Bryan Tong Minh escribió:
No. The solution you mentioned is the only one.
Well, clear as water :)

The problem is that, once you deep into a "X" level of depth category from the one you start, not all of them has articles. I've found some categories that has just caterogies ... Interesting function to code :)

Thank you for the fast response
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Platonides | 12 Dec 2009 22:45
Picon

Re: Random article of a category

Skiiiks escribió:
> Bryan Tong Minh escribió:
>> No. The solution you mentioned is the only one.
>>   
> Well, clear as water :)
> 
> The problem is that, once you deep into a "X" level of depth category
> from the one you start, not all of them has articles. I've found some
> categories that has just caterogies ... Interesting function to code :)
> 
> Thank you for the fast response

Then the category tree is not too well organised. Having only categories
on the first levels and then articles in then would be much more logical.

The issue with child categories is that the category organization is up
to the wiki community. There may be loops. The articles may be both in
the parent and child categories, it may have hundreds of descendants...
...and the operation would need to be efficient.
Skiiiks | 13 Dec 2009 00:49
Picon

Re: Random article of a category

Platonides escribió:
> Then the category tree is not too well organised. Having only categories
> on the first levels and then articles in then would be much more logical.
>
> The issue with child categories is that the category organization is up
> to the wiki community. There may be loops. The articles may be both in
> the parent and child categories, it may have hundreds of descendants...
> ...and the operation would need to be efficient.
>   

Platonides, as you said, the categories are a mess in the Wikipedia. The 
"Categorization" proyect just try to put, at least, one category holding 
each article, but the category tree is hand work of the wikipedians. 
There's no tree, there's a lot of orphans categories, duplicated ones, 
and a lot of loops and crosses.

That's because I assume a simple recursive depth search is the only 
solution for getting a random article in a category (or their childs)
Prunka, Sean | 16 Dec 2009 15:52
Picon
Favicon

XML parsing error?

Hey all, I hope someone can point me in the right direction:

I'm fairly sure this is caused by an extension we've written, but I don't know where to look.

We are using MW 1.13.2 and are not able to upgrade at this time.
We work on a closed system, and have written *many* extensions and hooks to our wiki.
We have only two extensions to the API. There is no extra whitespace or output from the API extensions. (I
comment out the include and the $wgAPIModules['function'] lines for both of them, call the API and still
get the error. I tried calling the live wikipdeia api and do not get this error. So the bug is very likely our
own, but I don't know where to look.

I get the following error when I call the API (any action)

XML Parsing Error: XML or text declaration not at start of entity
Location: http://localhost/path/to/wiki/api.php?action=actionx
Line Number 2, Column 1:

Where else should I look for the output/whitespace?

Thanks,
Sean
Roan Kattouw | 16 Dec 2009 16:10
Picon

Re: XML parsing error?

2009/12/16 Prunka, Sean <PRUNKAS <at> battelle.org>:
> Hey all, I hope someone can point me in the right direction:
>
> I'm fairly sure this is caused by an extension we've written, but I don't know where to look.
>
> We are using MW 1.13.2 and are not able to upgrade at this time.
> We work on a closed system, and have written *many* extensions and hooks to our wiki.
> We have only two extensions to the API. There is no extra whitespace or output from the API extensions. (I
comment out the include and the $wgAPIModules['function'] lines for both of them, call the API and still
get the error. I tried calling the live wikipdeia api and do not get this error. So the bug is very likely our
own, but I don't know where to look.
>
>
> I get the following error when I call the API (any action)
>
> XML Parsing Error: XML or text declaration not at start of entity
> Location: http://localhost/path/to/wiki/api.php?action=actionx
> Line Number 2, Column 1:
>
> Where else should I look for the output/whitespace?
>

The whitespace could be in any file, anywhere (although it's very
likely not in MW core). Look through your extension files (including
third-party extensions) and:
* Kill leading whitespace before first <?php
* Remove the ?> tag at the end, it's unnecessary
* Carefully inspect inline HTML between ?> and <?php , if any, and
convince yourself it's conditional

You could also try disabling extensions (by commenting out the
require_once line in LocalSettings.php) one by one until you find the
guilty one.

Roan Kattouw (Catrope)
Prunka, Sean | 16 Dec 2009 16:22
Picon
Favicon

Re: XML parsing error?

Thanks. The last bit is the one I'm hitting already. We have a Java Programmer that uses require_once in
every file that calls the other files, so it's a nice tangled mess, but I am sorting it all out. I think I've
gotten narrowed done to a handful of possible culprits.

I'm expecting to find an extra line after a closing tag... but I had forgotten to check for leading
whitespace. Thanks again!

-----Original Message-----
From: mediawiki-api-bounces <at> lists.wikimedia.org
[mailto:mediawiki-api-bounces <at> lists.wikimedia.org] On Behalf Of Roan Kattouw
Sent: Wednesday, December 16, 2009 10:10 AM
To: MediaWiki API announcements & discussion
Subject: Re: [Mediawiki-api] XML parsing error?

2009/12/16 Prunka, Sean <PRUNKAS <at> battelle.org>:
> Hey all, I hope someone can point me in the right direction:
>
> I'm fairly sure this is caused by an extension we've written, but I don't know where to look.
>
> We are using MW 1.13.2 and are not able to upgrade at this time.
> We work on a closed system, and have written *many* extensions and hooks to our wiki.
> We have only two extensions to the API. There is no extra whitespace or output from the API extensions. (I
comment out the include and the $wgAPIModules['function'] lines for both of them, call the API and still
get the error. I tried calling the live wikipdeia api and do not get this error. So the bug is very likely our
own, but I don't know where to look.
>
>
> I get the following error when I call the API (any action)
>
> XML Parsing Error: XML or text declaration not at start of entity
> Location: http://localhost/path/to/wiki/api.php?action=actionx
> Line Number 2, Column 1:
>
> Where else should I look for the output/whitespace?
>

The whitespace could be in any file, anywhere (although it's very
likely not in MW core). Look through your extension files (including
third-party extensions) and:
* Kill leading whitespace before first <?php
* Remove the ?> tag at the end, it's unnecessary
* Carefully inspect inline HTML between ?> and <?php , if any, and
convince yourself it's conditional

You could also try disabling extensions (by commenting out the
require_once line in LocalSettings.php) one by one until you find the
guilty one.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Platonides | 16 Dec 2009 17:01
Picon

Re: XML parsing error?

Prunka, Sean wrote:
> Thanks. The last bit is the one I'm hitting already. We have a Java Programmer that uses require_once in
every file that calls the other files, so it's a nice tangled mess, but I am sorting it all out. I think I've
gotten narrowed done to a handful of possible culprits.
> 
> I'm expecting to find an extra line after a closing tag... but I had forgotten to check for leading
whitespace. Thanks again!

Note that ?> at the end of file is optional, so you can remove it and
that way there won't be any extra line.

Another possibility is that one of your files has a BOM on one file
(some editors, like notepad like to add them). It's a tricky issue since
many editors won't display it, being invisible on editing but still
breaking your php pages.

Gmane