本文整理匯總了PHP中Twitter::Tweet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twitter::Tweet方法的具體用法?PHP Twitter::Tweet怎麽用?PHP Twitter::Tweet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Twitter
的用法示例。
在下文中一共展示了Twitter::Tweet方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: unset
if ($updatedata['min_interval'] == 0 or $updatedata['max_queued'] <= 1) {
$dm = 'Success! I\'ll now send you an email as soon as I see that you\'ve had a reply. Please see http://twitapps.com/replies for why this may not always be instant.';
} else {
$dm = 'Success! I\'ll now send you an email every ' . $updatedata['min_interval'] / 60 . ' minute' . ($updatedata['min_interval'] == 60 ? '' : 's') . ' or when you\'ve had ' . $updatedata['max_queued'] . ' replies, whichever occurs sooner.';
}
} else {
$dm = 'An unhandled error occurred when setting the frequency preference. Try again or contact @twitapps.';
}
}
}
break;
default:
$dm = 'Unknown option "' . $bits[0] . '". Please see http://twitapps.com/replies for valid options.';
break;
}
Twitter::Tweet('d ' . $headers['x-twittersenderscreenname'] . ' ' . $dm);
unset($dm);
break;
default:
$pos = strpos($word, '@');
if ($pos !== false and $pos !== 0) {
$email = $word;
break 2;
}
}
}
if ($email !== false) {
//echo 'Activate for "'.$headers['x-twittersenderscreenname'].'"'."\n";
if (!User::Activate($headers['x-twittersenderscreenname'], $email)) {
echo ' Failed to activate user "' . $headers['x-twittersenderscreenname'] . '": ' . mysql_error(GetDB()) . "\n";
}
示例2: Stats
function __construct() {
date_default_timezone_set("GMT");
$this->connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $this->access_key, $this->access_secret);
$content = $this->connection->get("account/rate_limit_status");
echo '<p style="font:11px Verdana;">Current API hits remaining: <strong>' . $content->remaining_hits . "</strong>";
$this->user = $this->connection->get("account/verify_credentials");
}
public function Stats($method, $response, $http_code, $parameters = '') {
echo '<p style="font:11px Verdana;">' . $method. " / <strong>" . $http_code . '</strong></p>';
}
public function Tweet($tweet) {
$parameters = array("status" => $tweet);
$status = $this->connection->post("statuses/update", $parameters);
$this->Stats("statuses/update", $status, $this->connection->http_code, $parameters);
}
}
$Bot = new Twitter();
$Bot->Tweet("http://github.com/abraham/twitteroauth/ + http://github.com/edwardhotchkiss/Twitter-Bot");
?>
示例3: date
case 'monthly':
$dm = 'Success! I\'ll now send you a monthly update by email on the ' . date('jS', strtotime('2010-01-' . (strlen($updatedata['when']) == 1 ? '0' : ''))) . ' ' . $hour;
break;
}
} else {
$dm = 'An unhandled error occurred when setting the frequency preference. Try again or contact @twitapps.';
}
}
}
}
break;
default:
$dm = 'Unknown option "' . $bits[0] . '". Please see http://twitapps.com/follows for valid options.';
break;
}
Twitter::Tweet('d ' . $info['headers']['x-twittersenderscreenname'] . ' ' . $dm);
unset($dm);
break;
default:
$pos = strpos($word, '@');
if ($pos !== false and $pos !== 0) {
$email = $word;
break 2;
}
}
}
if ($email !== false) {
//echo 'Activate for "'.$info['headers']['x-twittersenderscreenname'].'"'."\n";
if (!User::Activate($info['headers']['x-twittersenderscreenname'], $email)) {
echo ' Failed to activate user "' . $info['headers']['x-twittersenderscreenname'] . '": ' . mysql_error(GetDB()) . "\n";
}
示例4: dirname
<?php
require dirname(__FILE__) . '/../fx.php';
while (@ob_end_clean()) {
}
$skipping = true;
$page = 1;
while ($page !== false) {
$followers = Twitter::GetFollowers('ta_follows', $page);
foreach ($followers as $f) {
$exists = User::Exists($f['screen_name']);
if ($exists or $skipping) {
continue;
}
$skipping = false;
$user = Twitter::Follow($headers['x-twittersenderscreenname']);
if (User::Create($f)) {
echo $f['screen_name'] . " created\n";
Twitter::Tweet('d ' . $f['screen_name'] . ' Welcome to Follows from TwitApps. Send your email address by direct message to @ta_follows to activate this service.');
} else {
echo 'Failed to create user for ' . $f['screen_name'] . ': ' . mysql_error() . "\n";
}
}
if (count($followers) == 100) {
$page++;
} else {
$page = false;
}
}
示例5: twitter
function twitter()
{
Twitter::Tweet($productUrl);
}
示例6: twitter
function twitter()
{
Twitter::Tweet($input);
}