To attract Technorati and Twitter traffic, I’m now getting all my posts logged at Twitter, and manually pinging Technorati. But I was thinking: If I’m going to ping Technoratiy, wouldn’t it be great if I could get some of my tag words into the Twitter log?
Of course it would!
So, I decided to modify the string I send using WordTwit: This involves adding code to WordTwit. But what should I send to Twitter?
Examining twitter, I noticed I get to enter 140 characters. I also noticed the url gets changed into a tinyurl that takes up to 28 characters- which I will round up “just in case”. I’m guessing (only guessing) that to get tags to show, I need to keep the title, tags and any extra characters to less than 110 characters. (That leaves room for the 30 character tiny url.)
So, I did a bit of coding to chop long titles down to 40 characters and slap on some categories at the end of the the message . I only add categories if they fit inside the 110 character budget.
The only way to test this is to post, so I’m doing that. We’ll see if this shows at Twitter! Here’s sort of what my Twit should look like if it works:
$titleLength=strlen ( $shortTitle );
$tagLength=100-$titleLength; // twitter permits 140. The tiny url uses up to 30, other text uses about 10
foreach((get_the_category()) as $cat) {
$shortCats .= $cat->cat_name . ‘ ‘;
//echo(‘
short cats= ‘.$shortCats);
}
$shortCats=trim( substr($shortCats, 0, $tagLength) );
$i = ‘\” . $shortTitle . ‘\’ - ‘ . get_permalink().’ ‘.$shortCats;
echo(‘
‘.$i);
?>
This may or may not work. If it doesn’t, you’ll see a another test (with the tags listed before the url!)
Wish me luck! ![]()