What is the Full URL of the images returned by a wikipedia query...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the Full URL of the images returned by a wikipedia query...

the6e
If I run the following URL, I receive the following xml in return.  

My question is...  The xml returned is meant to be a list of images on a specific page, which it is!
BUT I don't know how I would reference these images in order to have them appear in my page.  What is the full URL of these images?  ANyone?

<a href="http://en.wikipedia.org/w/api.php?action=query&amp;list=allimages&amp;ailimit=10&amp;aifrom=New_Jersey_Devils&amp;aiprop=dimensions|mime">http://en.wikipedia.org/w/api.php?action=query&list=allimages&ailimit=10&aifrom=New_Jersey_Devils&aiprop=dimensions|mime

<?xml version="1.0"?>
<api>
  <query>
    <allimages>
      <img name="New_Jersey_Devils&#039;_Retired_Numbers.jpg" size="3587985" width="4000" height="3000" mime="image/jpeg" />
      <img name="New_Jersey_Devils_logo.svg" size="6176" width="159" height="160" mime="image/svg+xml" />
      <img name="New_Jersey_Devils_old_logo.svg" size="6206" width="159" height="160" mime="image/svg+xml" />
      <img name="New_Jersey_Drive.jpg" size="70297" width="580" height="864" mime="image/jpeg" />
      <img name="New_Jersey_Drive_2.jpg" size="11227" width="200" height="197" mime="image/jpeg" />
      <img name="New_Jersey_Drive_Vol_1.jpg" size="16005" width="240" height="240" mime="image/jpeg" />
      <img name="New_Jersey_Grizzlies.PNG" size="36160" width="150" height="150" mime="image/png" />
      <img name="New_Jersey_Guber_1997.PNG" size="5910" width="251" height="450" mime="image/png" />
      <img name="New_Jersey_Guber_2001.PNG" size="5902" width="251" height="450" mime="image/png" />
      <img name="New_Jersey_Guber_2005.PNG" size="5835" width="251" height="450" mime="image/png" />
    </allimages>
  </query>
  <query-continue>
    <allimages aifrom="New Jersey Human Services Police.jpg" />
  </query-continue>
</api>

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: What is the Full URL of the images returned by a wikipedia query...

Betacommand
use <a href="http://en.wikipedia.org/w/api.php?action=query&amp;list=allimages&amp;ailimit=10&amp;aifrom=New_Jersey_Devils&amp;aiprop=dimensions|mime|url">http://en.wikipedia.org/w/api.php?action=query&list=allimages&ailimit=10&aifrom=New_Jersey_Devils&aiprop=dimensions|mime|url

On Mon, Jan 24, 2011 at 10:22 AM, A O <[hidden email]> wrote:
If I run the following URL, I receive the following xml in return.  

My question is...  The xml returned is meant to be a list of images on a specific page, which it is!
BUT I don't know how I would reference these images in order to have them appear in my page.  What is the full URL of these images?  ANyone?

http://en.wikipedia.org/w/api.php?action=query&list=allimages&ailimit=10&aifrom=New_Jersey_Devils&aiprop=dimensions|mime

<?xml version="1.0"?>
<api>
  <query>
    <allimages>
      <img name="New_Jersey_Devils&#039;_Retired_Numbers.jpg" size="3587985" width="4000" height="3000" mime="image/jpeg" />
      <img name="New_Jersey_Devils_logo.svg" size="6176" width="159" height="160" mime="image/svg+xml" />
      <img name="New_Jersey_Devils_old_logo.svg" size="6206" width="159" height="160" mime="image/svg+xml" />
      <img name="New_Jersey_Drive.jpg" size="70297" width="580" height="864" mime="image/jpeg" />
      <img name="New_Jersey_Drive_2.jpg" size="11227" width="200" height="197" mime="image/jpeg" />
      <img name="New_Jersey_Drive_Vol_1.jpg" size="16005" width="240" height="240" mime="image/jpeg" />
      <img name="New_Jersey_Grizzlies.PNG" size="36160" width="150" height="150" mime="image/png" />
      <img name="New_Jersey_Guber_1997.PNG" size="5910" width="251" height="450" mime="image/png" />
      <img name="New_Jersey_Guber_2001.PNG" size="5902" width="251" height="450" mime="image/png" />
      <img name="New_Jersey_Guber_2005.PNG" size="5835" width="251" height="450" mime="image/png" />
    </allimages>
  </query>
  <query-continue>
    <allimages aifrom="New Jersey Human Services Police.jpg" />
  </query-continue>
</api>

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: What is the Full URL of the images returned by a wikipedia query...

b-jorsch
In reply to this post by the6e
On Mon, Jan 24, 2011 at 10:22:06AM -0500, A O wrote:
>
> The xml returned is meant to be a list of images on a specific page,
> which it is!

No it isn't. It's a list of the first 10 images (out of all images)
starting from the first one whose name sorts after the string "New
Jersey Devils". They aren't all used on the same page, and it's possible
some are not used in any page at all.

If you want the list of images on a particular page, use prop=images
instead of list=allimages. In your case, you'd probably want to use it
as a generator and combine it with prop=imageinfo, something like this:
http://en.wikipedia.org/w/api.php?action=query&titles=New_Jersey_Devils&generator=images&gimlimit=10&prop=imageinfo&iiprop=url|dimensions|mime

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api