當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpFlickr::auth_getFrob方法代碼示例

本文整理匯總了PHP中phpFlickr::auth_getFrob方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpFlickr::auth_getFrob方法的具體用法?PHP phpFlickr::auth_getFrob怎麽用?PHP phpFlickr::auth_getFrob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpFlickr的用法示例。


在下文中一共展示了phpFlickr::auth_getFrob方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: phpFlickr

<?php

require_once 'phpFlickr/phpFlickr.php';
$key = "";
$secret = "";
$frob = "";
$token = "";
$f = new phpFlickr($key, $secret);
$read_directory = "/tmp/Snapshots/";
$write_directory = "/tmp/Snapshots_Bak/";
$title = "FlickrSync";
$desc = "FlickrSync";
$tags = "flickrsync";
if (empty($frob)) {
    $frob = $f->auth_getFrob();
    $api_sig = md5($secret . "api_key" . $key . "frob" . $frob . "permswrite");
    $auth_url = "http://flickr.com/services/auth/?api_key={$key}&perms=write&frob={$frob}&api_sig={$api_sig}";
    echo "TWO STEPS YOU MUST NOW TAKE:\n\n";
    echo "1. SET THE frob VARIABLE TO: {$frob}\n\n";
    echo "2. VISIT {$auth_url} AND APPROVE THE APPLICATION!\n\n";
    echo "RERUN WHEN YOU HAVE SET FROB\n\n";
} elseif (empty($token)) {
    $token = $f->auth_getToken($frob);
    echo "PLEASE SET THE TOKEN VALUE TO THE TOKEN MENTIONED BELOW, SAVE, AND RERUN THE APPLICATION:";
    echo print_r($token) . "\n\n\n";
} else {
    $f->setToken($token);
    echo "ENTERING MASTER LOOP\n";
    while (1) {
        echo "I'm awake!!!\n";
        $filenames_to_upload = array();
開發者ID:skeevis,項目名稱:phpflickrsync,代碼行數:31,代碼來源:flickrsync.php


注:本文中的phpFlickr::auth_getFrob方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。