PEAR::Flickr_API

INSTALLATION

UPGRADING

USAGE

	require_once 'Flickr/API.php';


	# create a new api object

	$api =& new Flickr_API(array(
			'api_key'  => '1234567890',
		));


	# call a method

	$response = $api->callMethod('flickr.test.echo', array(
			'foo' => 'bar',
		));


	# check the response

	if ($response){
		# response is an XML_Tree root object
	}else{
		# fetch the error
		$code = $api->getErrorCode();
		$message = $api->getErrorMessage();
	}
	

METHODS

void Flickr_API(array $params)
The constructor takes an optional array of parameters as follows:
api_key
Your Flickr API key
api_secret
The auth secret tied to your API key (only needed for authenticated calls)
endpoint
The Flickr REST endpoint (a sensible default is used when you don't specify one)
auth_endpoint
The Flickr Auth endpoint (a sensible default is used when you don't specify one)
conn_timeout
HTTP connection timeout in seconds (defaults to 5)
io_timeout
HTTP IO timeout in seconds (defaults to 5)
XML_Tree callMethod(string $method, array $params)
Calls the method $method with an optional array of parameters.
integer getErrorCode()
Returns the error code for the last method call.
string getErrorMessage()
Returns the error message for the last method call.
string getAuthUrl(string $perms, string $frob='')
Returns a signed url to direct an authenticating user to. A frob only needs to be passed for non-web applications.