当前位置: 首页>>代码示例>>PHP>>正文


PHP tmhOAuth::auto_fix_time_request方法代码示例

本文整理汇总了PHP中tmhOAuth::auto_fix_time_request方法的典型用法代码示例。如果您正苦于以下问题:PHP tmhOAuth::auto_fix_time_request方法的具体用法?PHP tmhOAuth::auto_fix_time_request怎么用?PHP tmhOAuth::auto_fix_time_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tmhOAuth的用法示例。


在下文中一共展示了tmhOAuth::auto_fix_time_request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tmhOAuth

 * This example differs from others in that it will reattempt a request if
 * the timestamp is detected to be off from the Twitter servers.
 *
 * Instructions:
 * 1) If you don't have one already, create a Twitter application on
 *      http://dev.twitter.com/apps
 * 2) From the application details page copy the consumer key and consumer
 *      secret into the place in this code marked with (YOUR_CONSUMER_KEY
 *      and YOUR_CONSUMER_SECRET)
 * 4) Visit the 'My Access Token' screen linked to from your application
 *      details page
 * 5) Copy the user token and user secret into the place in this code marked
 *      with (A_USER_TOKEN and A_USER_SECRET)
 * 6) Visit this page using your web browser.
 *
 * @author themattharris
 */
require '../tmhOAuth.php';
$tmhOAuth = new tmhOAuth(array('consumer_key' => 'YOUR_CONSUMER_KEY', 'consumer_secret' => 'YOUR_CONSUMER_SECRET', 'user_token' => 'A_USER_TOKEN', 'user_secret' => 'A_USER_SECRET'));
// for the demo set the timestamp to yesterday
$tmhOAuth->config['force_timestamp'] = true;
$tmhOAuth->config['timestamp'] = strtotime('yesterday');
$tmhOAuth->auto_fix_time_request('GET', $tmhOAuth->url('1/account/verify_credentials'));
if ($tmhOAuth->response['code'] == 200) {
    if ($tmhOAuth->auto_fixed_time) {
        echo 'Had to auto adjust the time. Please check the date and time is correct on your device/server';
    }
    $tmhOAuth->pr(json_decode($tmhOAuth->response['response']));
} else {
    $tmhOAuth->pr(htmlentities($tmhOAuth->response['response']));
}
开发者ID:joecannatti,项目名称:SPACES_GIVECAMP,代码行数:31,代码来源:auto_fix_time.php


注:本文中的tmhOAuth::auto_fix_time_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。