Retrieves images from Flickr®.
If neither user-id, nor photoset-id is specified, then tags and/or query must be specified, otherwise an error will be thrown.
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
api-key | The api-key attribute identifies your application. It is your responsibility to request and manage your own API key. Refer to Flickr Services for further information. | xs:integer | required | ||
page-index | An optional number of the page to return in the response. It is not an error if the value of this attribute is greater than the actual number of pages, in that case an empty response is returned. | xs:integer | 1 | [1,∞] | optional |
page-size | An optional number of images returned in a single response page. It is an error if the value is outside the range. | xs:integer | 10 | [1,500] | optional |
photoset-id | Flickr photoset ID. | xs:string | optional | ||
query | An optional query string. If specified, then only the photos that contain the same string in either their title, or one of their tags will be returned. The matching is case insensitive. | xs:string | optional | ||
tags | Contains space separated set of tags. If specified, then only the images that have all these tags associated with them will be returned. | xs:string | optional | ||
user-id | Displays images that belong to the selected user. | xs:string | optional |
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline"
xmlns:flickr="http://www.volantis.com/xmlns/2008/08/flickr">
<head>
<title>Flickr photos by user</title>
</head>
<body>
<pipeline:transform href="flickr2xdime.xsl">
<flickr:list-photos api-key="to-be-provided-by-page-author" user-id="30193659@N08"/>
</pipeline:transform>
</body>
</html>
The flickr2xdime.xsl transform converts the Flickr service response to XDIME.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:flickr="urn:flickr:">
<xsl:template match="/">
<h1>Flickr gallery</h1>
<xsl:for-each select="//photo">
<div>
<p>
<xsl:value-of select="@title"/>
</p>
<object srctype="image/jpeg">
<xsl:attribute name="src">http://farm<xsl:value-of select="@farm"
/>.static.flickr.com/<xsl:value-of select="@server"/>/<xsl:value-of select="@id"
/>_<xsl:value-of select="@secret"/>.jpg</xsl:attribute>
<param name="mcs-external-label">
<xsl:attribute name="value">
<xsl:value-of select="@title"/>
</xsl:attribute>
</param>
</object>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>