Example #1
0
    public function sendTweet()
    {
        $identity = Zend_Auth::getInstance()->getIdentity();
        $accountId = $identity->account_id;
        $regInfoModel = new Model_RegistryInfo();
        $regInfo = $regInfoModel->getOrgRegistryInfo($accountId);
        $registryUrl = "/publisher/" . $regInfo->publisher_id;
        $model = new User_Model_DbTable_Account();
        $row = $model->getAccountRowById($accountId);
        // If twitter screen name is present
        $twitter = $this->verifyCredentials();
        if (is_object($twitter)) {
            if (strlen($row['twitter']) != 0) {
                $status = $row['name'] . ' ' . $row['twitter'] . ' has published their #IATIData. View the 
							data here: http://iatiregistry.org' . $registryUrl . ' #AidStream';
            } else {
                $status = $row['name'] . ' has published their #IATIData. View the 
							data here: http://iatiregistry.org' . $registryUrl . ' #AidStream';
            }
            $twitter->statuses->update($status);
        } else {
            return false;
        }
    }