Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/testing/resttest.php
<%
function get_flickr_thumb( $argPhotoId ) {
	# XML content :
	$key = "91640f92a17280b1953f02c0b79956bf";
	$xml='<' . '?' . 'xml version="1.0"?>
			<page url="www.flickr.com/services/rest/?method=flickr.photos.getSizes&amp;api_key=' . $key . '&amp;photo_id=' . $argPhotoId . '">W3C Recommendation page</page>';

	# XSL content :
	$xsl='<' . '?xml version="1.0"?>
	<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes"/>
	<xsl:template match="/">
		 <xsl:value-of select="document(concat(\'http:\',page/@url))/rsp/sizes/size[@label=\'Thumbnail\']/@source"/>
	</xsl:template>
	</xsl:stylesheet>';

	# handler:
	function handGetAll($processor,$scheme,$rest) {
		$rest=substr($rest,1);
		switch($scheme) {
			case 'http':
				$uri = "http://".$rest;
				$ch = curl_init( $uri );
				curl_setopt($ch, CURLOPT_HEADER, 0);
				ob_start();
				curl_exec($ch);
				curl_close($ch);
				$c = ob_get_clean();
				return $c;
			}
		break;
	}

	$xh = xslt_create();
	xslt_set_scheme_handlers($xh,array("get_all" => "handGetAll"));
	$out = xslt_process($xh,'arg:/_xml', 'arg:/_xsl',NULL,array("/_xml"=>$xml,"/_xsl"=>$xsl));
	xslt_free($xh);
	return $out;
}
%>
Return current item: FeedMeLinks, Social BookmarkingSince2002