I was looking at the Yahoo YUI DHTML toolkit, and they have an example of
querying Flickr
via the REST API. The of course have to use a proxy, so they included this
little PHP
proxy for data
<?php
// Yahoo! proxy
// Hard-code hostname and path:
define ('PATH', 'http://www.flickr.com/services/rest/');
// Get all query params
$query = "?";
foreach ($_GET as $key => $value) {
$query .= urlencode($key)."=".urlencode($value)."&";
}
foreach ($_POST as $key => $value) {
$query .= $key."=".$value."&";
}
$query .= "&api_key=30cc0cf363608a1ffa3fc1631854c8b8";
$url = PATH.$query;
// Open the Curl session
$session = curl_init($url);
// Don't return HTTP headers. Do return the contents of the call
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Make the call
$response = curl_exec($session);
header("Content-Type: text/xml");
echo $response;
curl_close($session);
?>
We ought to ship something like this as an example for people who want to
run SOLO apps that access
3rd party services, particularly DHTML runtime apps.
It's nice because they hardcoded it with a backend pathname on the server,
thus not causing a security hole with a wide open proxy, for people running
it on their servers.
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]