我正在尝试完成这项工作,但是我需要有关此功能的帮助。它工作得很好,但是在我修改它以显示来自 Temboo 的 choreos 的用户仪表板后,我没有得到任何结果。这两个函数位于不同的 php 文件中,即 index.php 和 dashboard.php 。请告诉我我可能在哪里出错。谢谢
主要来源:https ://raw.github.com/matthewflaming/temboo-experiments/master/TumblrOauth/tumblrOauth.php
我的dashboard.php:https ://tumblr-app-c9-c9-paulkinobunga.c9.io/dashboard.php
也看到我的 index.php 文件将 dahboard.php 替换为 index.php
功能
function getUserInfo($session) {
global $AccessToken, $AccessTokenSecret;
// Instantiate the Choreo, using a previously instantiated Temboo_Session object, eg:
$getUserInformation = new Tumblr_User_GetUserInformation($session);
// Get an input object for the Choreo
$getUserInformationInputs = $getUserInformation->newInputs();
// Set inputs
$getUserInformationInputs->setAPIKey(TUMBLR_CONSUMER_KEY)->setAccessToken($AccessToken)->setAccessTokenSecret($AccessTokenSecret)->setSecretKey(TUMBLR_CONSUMER_SECRET);
// Execute Choreo and get results
$getUserInformationResults = $getUserInformation->execute($getUserInformationInputs)->getResults();
return $getUserInformationResults;
}
为了得到回应,我简单地说:
Tumblr 返回的原始响应:
<?php
// Get current user info for Tumblr
$currentUserResults = getUserInfo($session);
print_r($currentUserResults);
?>
修改后的功能
function getUserDash($session) {
global $AccessToken, $AccessTokenSecret;
// Instantiate the Choreo, using a previously instantiated Temboo_Session object, eg:
$getUserDashboard = new Tumblr_User_GetUserDashboard($session);
// Get an input object for the Choreo
$getUserDashboardInputs = $getUserDashboard->newInputs();
// Set inputs
$getUserDashboardInputs->setAPIKey(TUMBLR_CONSUMER_KEY)->setAccessToken($AccessToken)->setAccessTokenSecret($AccessTokenSecret)->setSecretKey(TUMBLR_CONSUMER_SECRET);
// Execute Choreo and get results
$getUserDashboardResults = $getUserDashboard->execute($getUserDashboardInputs)->getResults();
return $getUserDashboardResults;
}
为了得到回应,我说
//Raw response returned by Tumblr:<br>
<?php
// Get current user info for Tumblr
$currentUserResults = getUserDash($session);
print_r($currentUserResults);
?>
这两个函数位于不同的 php 文件中,即 index.php 和 dashboard.php 。请告诉我我可能在哪里出错。