ok, for those who want to post thread replies and new threads to twitter -- I think I figured this out.
1. Use the following to create a string for new threads (modify to suite you, but leave the datestamp portion in) -- keep the rest of the provided plugin code as is:
PHP Code:
$tweet = '';
if (isset($newpost['prefixid']) && $newpost['prefixid'] != '') {
$tweet .= date("YMj g:i:s a") . ' ' . $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
}
$tweet .= date("Ydj g:i:s a") . ' ' .$newpost['title'].' '.$shortUrl;
$tweet .= ' new thread #mysearchterm'; //replace #mysearchterm with something related to your forum
2. Hook at newthread_post_complete
3. Use the following plugin code for replies:
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();
// If you are having trouble getting bitly URL shortening to work... disable it!
$useBitly = true;
if (!in_array($threadinfo[forumid], $excludedForums)) {
$shortUrl = 'http://www.myforumdomainname.co/showthread.php?t='.$threadinfo[threadid];
if ($useBitly) {
// http://classes.verkoyen.eu/bitly
require_once 'bitly.php';
$bitly = new Bitly('mybitlyaccountid', 'mybitlykey');
$shortUrl = $bitly->shorten($shortUrl);
}
$tweet = '';
$tweet .= date("YMj g:i:s a") . ' ' . $vbphrase['prefix_'.$threadinfo['prefixid'].'_title_plain'].' ';
$tweet .= $threadinfo['title'].' '.$shortUrl;
$tweet .= ' new reply #keyword'; //again, use a #keyword related to your forum
// http://classes.verkoyen.eu/twitter/
require_once 'twitter.php';
$twitter = new Twitter('mytwitteraccount','mypassword');
$twitter->updateStatus($tweet);
}
4. Use the following "two" hooks for the above code snippet:
newreply_post_ajax
newreply_post_complete
It looks like vBulletin triggers one or the other upon posting a new reply, but not both (and, most new posts will go through 'newreply_post_ajax'). vBulletin plugins are a new thing for me -- took a bit to figure this one out.
You can see a working feed at
http://www.twitter.com/mediawikiusers