Pierre-Olivier Latour | 1 Jun 2010 05:26
Favicon

Redirect does not provide any actual image info for "action=query&prop=imageinfo"

Hi,

I just noticed that if you use the "redirect" option with the "action=query&prop=imageinfo" API, it does provide a <redirects> element as expected, but there's no image info? You need to do a new query with the redirected image name to retrieve it.

I think this is different behavior from "redirect" in the other APIs, where it provides the info with the redirect at the same time. 

Is this a bug or expected?

http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&titles=File:Liberia%20court%20of%20arms.png&iiprop=timestamp%7Curl%7Csize%7Cdimensions%7Cmime%7Cmetadata&redirects&format=xmlfm&iiurlwidth=128&iiurlheight=128
<?xml version="1.0"?> <api> <query> <redirects> <r from="File:Liberia court of arms.png" to="File:Coat of arms of Liberia.png" /> </redirects> <pages> <page pageid="23044582" ns="6" title="File:Coat of arms of Liberia.png" imagerepository="" /> </pages> </query> </api>

<?xml version="1.0"?> <api> <query> <pages> <page pageid="23044582" ns="6" title="File:Coat of arms of Liberia.png" imagerepository="local"> <imageinfo> <ii timestamp="2009-06-01T14:04:00Z" size="14121" width="200" height="211" thumburl="http://upload.wikimedia.org/wikipedia/en/thumb/1/12/Coat_of_arms_of_Liberia.png/121px-Coat_of_arms_of_Liberia.png" thumbwidth="121" thumbheight="128" url="http://upload.wikimedia.org/wikipedia/en/1/12/Coat_of_arms_of_Liberia.png" descriptionurl="http://en.wikipedia.org/wiki/File:Coat_of_arms_of_Liberia.png" metadata="" mime="image/png" /> </imageinfo> </page> </pages> </query> </api>



-Pierre

________________________________
Pierre-Olivier Latour



_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Robert Ullmann | 1 Jun 2010 13:09
Picon

persistent HTTP connections

Hi,

I noted that MWclient uses, or tries to use, persistent HTTP
connections to the API.

I have a few questions, as I am looking at improving Interwicket,
which makes lots of API calls, and is sometimes driven nuts by the two
layers of proxies (here, on my side of the net) that are prone to
failing ...

Is using persistent connections a good idea?

What is the server-side timeout when a connection is idle?

Can I make requests to various different projects (xx.wiktionary, for
various xx) on the same connection (looks like it, as they all return
the same address)?

Just thinking about what would be best if I re-write a layer on my side (;-)

best,
Robert
Roan Kattouw | 1 Jun 2010 17:16
Picon

Re: Redirect does not provide any actual image info for "action=query&prop=imageinfo"

2010/6/1 Pierre-Olivier Latour <pol <at> cooliris.com>:
> Hi,
> I just noticed that if you use the "redirect" option with the
> "action=query&prop=imageinfo" API, it does provide a <redirects> element as
> expected, but there's no image info? You need to do a new query with the
> redirected image name to retrieve it.
> I think this is different behavior from "redirect" in the other APIs, where
> it provides the info with the redirect at the same time.
> Is this a bug or expected?
This is a bug, filed at https://bugzilla.wikimedia.org/show_bug.cgi?id=23750

Roan Kattouw (Catrope)
Roan Kattouw | 1 Jun 2010 17:18
Picon

Re: persistent HTTP connections

2010/6/1 Robert Ullmann <rlullmann <at> gmail.com>:
> Hi,
>
> I noted that MWclient uses, or tries to use, persistent HTTP
> connections to the API.
>
> I have a few questions, as I am looking at improving Interwicket,
> which makes lots of API calls, and is sometimes driven nuts by the two
> layers of proxies (here, on my side of the net) that are prone to
> failing ...
>
> Is using persistent connections a good idea?
>
For requests made in rapid succession, definitely. For requests that
are further apart, maybe.

> What is the server-side timeout when a connection is idle?
>
No idea. You could find out by trying :)

> Can I make requests to various different projects (xx.wiktionary, for
> various xx) on the same connection (looks like it, as they all return
> the same address)?
>
Yes, they all return the same IP address.

Roan Kattouw (Catrope)
Robert Ullmann | 1 Jun 2010 17:24
Picon

Re: persistent HTTP connections

Hi,

Thanks, I've coded it (very easily, somewhat less code than there was,
"urllib2" just makes things more complicated than the httplib I/F ;-)

Does the API put *really* want the text in the encoded URL? It does
work ... but isn't it sometimes kinda long?

Robert

On Tue, Jun 1, 2010 at 6:18 PM, Roan Kattouw <roan.kattouw <at> gmail.com> wrote:
> 2010/6/1 Robert Ullmann <rlullmann <at> gmail.com>:
>> Hi,
>>
>> I noted that MWclient uses, or tries to use, persistent HTTP
>> connections to the API.
>>
>> I have a few questions, as I am looking at improving Interwicket,
>> which makes lots of API calls, and is sometimes driven nuts by the two
>> layers of proxies (here, on my side of the net) that are prone to
>> failing ...
>>
>> Is using persistent connections a good idea?
>>
> For requests made in rapid succession, definitely. For requests that
> are further apart, maybe.
>
>> What is the server-side timeout when a connection is idle?
>>
> No idea. You could find out by trying :)
>
>> Can I make requests to various different projects (xx.wiktionary, for
>> various xx) on the same connection (looks like it, as they all return
>> the same address)?
>>
> Yes, they all return the same IP address.
>
> Roan Kattouw (Catrope)
>
> _______________________________________________
> Mediawiki-api mailing list
> Mediawiki-api <at> lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>
Roan Kattouw | 1 Jun 2010 17:26
Picon

Re: persistent HTTP connections

2010/6/1 Robert Ullmann <rlullmann <at> gmail.com>:
> Hi,
>
> Thanks, I've coded it (very easily, somewhat less code than there was,
> "urllib2" just makes things more complicated than the httplib I/F ;-)
>
> Does the API put *really* want the text in the encoded URL? It does
> work ... but isn't it sometimes kinda long?
>
You can use POST requests for all API modules.

Roan Kattouw (Catrope)
Bryan Tong Minh | 1 Jun 2010 23:17
Picon
Gravatar

Re: persistent HTTP connections

On Tue, Jun 1, 2010 at 5:24 PM, Robert Ullmann <rlullmann <at> gmail.com> wrote:
> Does the API put *really* want the text in the encoded URL? It does
> work ... but isn't it sometimes kinda long?
>
For that reason mwclient always makes post requests in
application/x-www-form-urlencoded :)

Bryan
Pierre-Olivier Latour | 2 Jun 2010 02:36
Favicon

Re: Redirect does not provide any actual image info for "action=query&prop=imageinfo"

Thanks for creating the bug report!

On Jun 2, 2010, at 12:16 AM, Roan Kattouw wrote:

> 2010/6/1 Pierre-Olivier Latour <pol <at> cooliris.com>:
>> Hi,
>> I just noticed that if you use the "redirect" option with the
>> "action=query&prop=imageinfo" API, it does provide a <redirects> element as
>> expected, but there's no image info? You need to do a new query with the
>> redirected image name to retrieve it.
>> I think this is different behavior from "redirect" in the other APIs, where
>> it provides the info with the redirect at the same time.
>> Is this a bug or expected?
> This is a bug, filed at https://bugzilla.wikimedia.org/show_bug.cgi?id=23750
> 
> Roan Kattouw (Catrope)
> 
> _______________________________________________
> Mediawiki-api mailing list
> Mediawiki-api <at> lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

-Pierre

________________________________
Pierre-Olivier Latour
pol <at> cooliris.com
Cyril Nicodème | 2 Jun 2010 08:44
Picon
Gravatar

Question about making a bot and the amount of requests

Hello everybody,

I am currently working on a project that would have the need to collect information about all the music artists present in the wikipedia database and I know it represent a lot of request to send.

It's the reason why I'm calling for your help.

Is this possible to do this without being blocked by the wikipedia servers ?

I looked at the api page to work with, the better idea I had would be to list every artist page I need with the help of the query action, look for the "lastrevid" key, and if it has changed, request the new page.

But still, the initial import would be very important.

How can I do that the proper way ?

I really appreciate for your help.

Thanks.

Cyril.

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Roan Kattouw | 2 Jun 2010 14:11
Picon

Re: Question about making a bot and the amount of requests

2010/6/2 Cyril Nicodème <cx42net <at> gmail.com>:
> Hello everybody,
>
> I am currently working on a project that would have the need to collect
> information about all the music artists present in the wikipedia database
> and I know it represent a lot of request to send.
>
> It's the reason why I'm calling for your help.
>
> Is this possible to do this without being blocked by the wikipedia servers ?
>
> I looked at the api page to work with, the better idea I had would be to
> list every artist page I need with the help of the query action, look for
> the "lastrevid" key, and if it has changed, request the new page.
>
> But still, the initial import would be very important.
>
> How can I do that the proper way ?
>
> I really appreciate for your help.
>
I recommend you do the initial import from a data dump instead:
http://meta.wikimedia.org/wiki/Data_dumps

Roan Kattouw (Catrope)

Gmane