topical media & game development

talk show tell print

mashup-delicious-11-autobookmarkers-flickr-get-token.php / php



  <?php
  //bring in Snoopy.class.php (from Magpie's extlib dir)
  require_once('lib/extlib/Snoopy.class.inc');
  snoopy = new Snoopy();
  
  define('API_KEY','apikey');
  define('SHARED_SECRET','sharedsecret');
  
  //fetch query string from arguments
  if (!isset(argv[1]))
      die("You need to give me your mini token.\n");
  else
      mini_token = argv[1];
  
  //create a new Snoopy object
  snoopy = new Snoopy;
  
  api_sig = md5(SHARED_SECRET."api_key".API_KEY."methodflickr.auth.getFullTokenmini_token"
  .mini_token);
  
  get_full_token=
  "http://flickr.com/services/rest/?method=flickr.auth.getFullToken&api_key="
  .API_KEY."&mini_token=".mini_token."&api_sig=".api_sig;
  
  snoopy->fetch(get_full_token);
  
  echo snoopy->results;
  ?>
  


(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.