Building off my previous entry Posting to WordPress via BlackBerry I’ve updated my wp-mail.php script to work with twitter_updater. It’s not the best solution but it works for now.

require_once(ABSPATH.'/wp-content/plugins/twitter_updater/twitter_updater.php');

do_action('publish_phone', $post_ID); // current update to WP

if (function_exists(vc_doTwitterAPIPost)) { // if twitter_updated exists: update
	$twitterURI = "/statuses/update.xml";
	$twit = $post_title . ' ( ' . get_permalink($post_ID) . ' )';
	$sendToTwitter = vc_doTwitterAPIPost('status='. $twit, $twitterURI);
	echo "\n<p>" . sprintf(__('<strong>Twitter:</strong> %s : %s'), $sendToTwitter, wp_specialchars($post_title)) . '</p>';
}

I also made some other updates to compensate for some changes to my email system which now base64 encodes part of the message. Here I added this code to split at the “base64″ marker instead or “quoted-printable” marker:

if (strpos($content, "Content-Transfer-Encoding: base64") !== false) {
	$content = explode('Content-Transfer-Encoding: base64', $content);
	$base64 = true;
}
$content = $content[1];
if ($base64) $content = base64_decode($content);
Reblog this post [with Zemanta]