Well, I finally got around to hacking the heck out of it and here's my version that uses is.gd instead of bit.ly (which I could never get to work). A shame there isn't some way to test this besides LIVE.
PHP Code:
// The array below are the ids of non-public forums, update these to be your admin forum ids or anything non-public by default
$excludedForums = array(0);
if (!in_array($foruminfo[forumid], $excludedForums)) {
$myUrl = 'http://www.myforum.com/forum/showthread.php?t='.$newpost[threadid];
$cURL_resource = curl_init();
curl_setopt($cURL_resource, CURLOPT_URL, 'http://is.gd/api.php?longurl=' . $myUrl);
curl_setopt($cURL_resource, CURLOPT_RETURNTRANSFER, 1);
$shortUrl = curl_exec($cURL_resource);
curl_close($cURL_resource);
$tweet = '';
if (isset($newpost['prefixid']) && $newpost['prefixid'] != '') {
$tweet = $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
}
$tweet .= $newpost['title'].' '.$shortUrl;
// http://classes.verkoyen.eu/twitter/
require_once 'twitter.php';
$twitter = new Twitter('MyTwitterName','MyTwitterPassword');
$twitter->updateStatus($tweet);
}