Hi Guys!
Does anyone know how using the Twitter API to post a status update along with a link?
I am using the following class/code (i’ve tried emailing the author, but no response):
/* Twitter Plugin */
require_once(DIR.'/includes/twitter/tmhOAuth.php');
require_once(DIR.'/includes/twitter/tmhUtilities.php');
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => 'secret',
'consumer_secret' => 'secret',
'user_token' => 'secret',
'user_secret' => 'secret'));
$twitter_content = $_POST['job_title'].' - '.strip_tags($_POST['job_description']).' '.SITEURL.'/'.$this->settings['company_directory'].'/'.$jobinfo['company_url'].'/'.$jobinfo['job_url'];
$code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array('status' => $twitter_content, 'wrap_links' => 'true'));
if($code == 200) {
tmhUtilities::pr(json_decode($tmhOAuth->response['response']));
} else {
tmhUtilities::pr($tmhOAuth->response['response']);
}
Please help, im at a dead end.
Thanks in advance.