Skip to content

Instantly share code, notes, and snippets.

@mimeoconnect
Created February 12, 2011 04:10
Show Gist options
  • Select an option

  • Save mimeoconnect/823496 to your computer and use it in GitHub Desktop.

Select an option

Save mimeoconnect/823496 to your computer and use it in GitHub Desktop.
This pulls photos from Flickr using the PHP and the Zend framework.
<?php
require_once 'Zend/Loader/Autoloader.php';
// API Key
$API_Key = '[api key]';
// Register the Zend Auto Loader
$loader = Zend_Loader_Autoloader::getInstance();
// Create New Instance using the Zend REST Client
$client = new Zend_Rest_Client('http://api.flickr.com/services/rest/');
// Performa Flickr Photo Search
$client->method('flickr.photos.search');
$client->api_key($API_Key);
// User ID
$client->user_id('66449089@N00');
// Flickr Arguements
$client->tags("instagram app");
$client->per_page(50);
$result = $client->get();
foreach ($result->photos->photo as $photo)
{
$photoUrl = sprintf('http://farm%s.static.flickr.com/%s/%s_%s_m.jpg', $photo['farm'], $photo['server'], $photo['id'], $photo['secret']);
$pageUrl = sprintf('http://www.flickr.com/photos/%s/%s', $photo['owner'], $photo['id']);
//echo $photoUrl . "<br />";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment