本文整理匯總了PHP中Twitter::createFriendship方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twitter::createFriendship方法的具體用法?PHP Twitter::createFriendship怎麽用?PHP Twitter::createFriendship使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Twitter
的用法示例。
在下文中一共展示了Twitter::createFriendship方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createFriendship
public function createFriendship($Model, $screenName)
{
return $this->_Twitter->createFriendship($screenName);
}
示例2: resetFriends
function resetFriends($deleteAll = false)
{
require_once PATH_CORE . '/utilities/twitter.php';
$tObj = new Twitter(TWITTER_USER, TWITTER_PWD, $this->db);
if ($deleteAll) {
$resp = $tObj->getFriendIds(TWITTER_USER);
foreach ($resp as $id) {
$tObj->deleteFriendship($id);
}
}
$mt = new microAccountsTable($this->db);
$ma = $mt->getRowObject();
$q = $this->db->query("SELECT * FROM MicroAccounts WHERE sid=0;");
while ($d = $this->db->readQ($q)) {
$ma->load($d->id);
$this->db->log('Process:' . $ma->shortName);
if ($ma->sid == 0) {
if ($tObj->existsFriendship(TWITTER_USER, $d->shortName)) {
$resp = $tObj->getFriendship(TWITTER_USER, $d->shortName);
$resp = $tObj->getUser($resp['target']['id']);
} else {
$resp = $tObj->createFriendship($d->shortName);
}
if ($resp !== false) {
$this->db->log($resp);
$ma->sid = $resp['id'];
$ma->friendlyName = $resp['name'];
$ma->profile_image_url = $resp['profile_image_url'];
$ma->update();
} else {
$this->db->log('FALSE');
}
}
}
}