General discussion of OpenCATS

Moderators: RussH, cptr13

Forum rules: Just remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but keep comments directed to the topic at hand.
User avatar
By alexukie
#772
Here we go Russ - I promised a while back... a quick hack that will get your CATS Twittering... ;) Enjoy!

Add this function to the top of your cats/lib/JobOrders.php --- right after include libraries:


function postToTwitter($username,$password,$message)
{
$host = "http://twitter.com/statuses/update.xml? ... .urlencode(stripslashes(urldecode($message)));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);

$result = curl_exec($ch);
// Look at the returned header
$resultArray = curl_getinfo($ch);

curl_close($ch);

if($resultArray['http_code'] == "200"){
$twitter_status='Your message has been sent! <a href="http://twitter.com/'.$username.'">See your profile</a>';
} else {
$twitter_status="Error posting to Twitter. Retry";
}
return $twitter_status;
}



.........
after add this to the bottom of public function add($title, $companyID, $contactID, $description, $notes,:
postToTwitter("YOUR_USER_NAME","YOUR_PASSWORD",str_replace("'","",$this->_db->makeQueryString($title)." Job in ".$this->_db->makeQueryString($city).", ".$this->_db->makeQueryString($state)." http://www.YOURSITE_WITH_CATS_ONIT.com/YOURURL_AND_JOBORDER?id=".$jobOrderID));

..... right before return $joborderid;

ENJOY!!!!!!!!!!!!
opencats Installation

Hello, What is the best web host to use for ope[…]

Best Install Platform

I was trying docker setup, initially tried getting[…]

Install questions

https://gbwhata.net/ is a modified version of th[…]

Information of devellopement

Hi Russ , are there any updates on the development[…]