Skip to content

Instantly share code, notes, and snippets.

@ravikiranj
Created March 26, 2011 06:09
Show Gist options
  • Save ravikiranj/888065 to your computer and use it in GitHub Desktop.
Save ravikiranj/888065 to your computer and use it in GitHub Desktop.
Modified version of getToken.php
<?php
/* Last updated with phpFlickr 1.4
*
* If you need your app to always login with the same user (to see your private
* photos or photosets, for example), you can use this file to login and get a
* token assigned so that you can hard code the token to be used. To use this
* use the phpFlickr::setToken() function whenever you create an instance of
* the class.
*/
require_once("phpFlickr.php");
$apiKey = "__your__app__apikey__";
$secret = "__your__app__secret__";
$perms = "write";
$f = new phpFlickr($apiKey, $secret);
//Redirect to flickr for authorization
if(!$_GET['frob']){
$f->auth($perms);
}else {
//If authorized, print the token
$tokenArgs = $f->auth_getToken($_GET['frob']);
echo "<pre>"; var_dump($tokenArgs); echo "</pre>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment