本文整理匯總了PHP中Twitter::twitterTimeline方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twitter::twitterTimeline方法的具體用法?PHP Twitter::twitterTimeline怎麽用?PHP Twitter::twitterTimeline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Twitter
的用法示例。
在下文中一共展示了Twitter::twitterTimeline方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
<?php
/**
* @author Stuart Wilson <stiuart@stuartwilsondev.com>
*/
require_once 'Twitter.php';
if (!file_exists('config.ini')) {
die('No Config');
}
$config = parse_ini_file('config.ini');
$twitter = new Twitter($config['access_token'], $config['access_token_secret'], $config['access_token_url'], $config['authorize_url'], $config['twitter_consumer_key'], $config['twitter_consumer_secret'], $config['twitter_request_token_url'], $config['twitter_username']);
header('Content-Type: application/json');
switch ($_GET['function']) {
case 'getwoeids':
echo $twitter->getAvailableWoeIds();
break;
case 'gettrends':
echo $twitter->getTrendsByWoeId($_GET['woeid']);
break;
case 'gettimeline':
echo $twitter->twitterTimeline($_GET['username'], $_GET['nooftweets']);
break;
}
示例2: Twitter
<?php
/**
* @author Stuart Wilson <stiuart@stuartwilsondev.com>
*/
require_once 'Twitter.php';
$config = parse_ini_file('config.ini');
$twitter = new Twitter($config['access_token'], $config['access_token_secret'], $config['access_token_url'], $config['authorize_url'], $config['twitter_consumer_key'], $config['twitter_consumer_secret'], $config['twitter_request_token_url'], $config['twitter_username']);
$tweets = $twitter->twitterTimeline($config['twitter_username'], 10);
$woeids = $twitter->getAvailableWoeIds();
$trends = $twitter->getTrendsByWoeId();