Created
February 12, 2011 04:10
-
-
Save mimeoconnect/823496 to your computer and use it in GitHub Desktop.
This pulls photos from Flickr using the PHP and the Zend framework.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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