topical media & game development

talk show tell print

mashup-flickr-11-Complete-visualizing-news-11-3.php / php



  <?php
  
  require_once(dirname(__FILE__) . '/../lib/phpFlickr/phpFlickr.php');
  require_once(dirname(__FILE__) . '/../lib/apikey.php');
  
  flickr = new phpFlickr(flickrApiKey, flickrSecret);
  
  keywords = array('bill', 'gates', 'microsoft');
  
  args = array(
    'tags' => join(keywords, ','),
    'tag_mode' => 'any',
    'sort' => 'relevance', 
    'page' => 1, 
    'per_page' => 6,
  );
  
  photos = flickr->photos_search(args);
  photoList = photos['photo'];
  ?>
  
  <ul>
  <?php
  foreach (photoList as photo)
  {
    squarePhoto = 'http://static.flickr.com/' . photo['server'] 
      . '/' . photo['id'] . '_' .photo['secret'] . '_s.jpg';
  ?>
    <li><img src="<?php echo squarePhoto ?>"></li>
  <?php 
  }
  ?>
  
  </ul>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.