Twitpress plugin now officially supports permalinks

January 19th, 2008 Jason

After my own attempts at hacking together a solution, it turns out Thomas Purnell has gone ahead and done a proper update to his Twitpress plugin, making it work where I hadn’t bothered to (yet.) Primarily, he added in some checks to make sure the POST was completed to the database prior to sending the tweet, an issue which was causing me all kinds of aggravation and one I really had no desire to dive into.

As I discuss in my previous post, the ability to have a post here automatically propagate out to my Twitter feed and to Facebook is fantastic, and with Twitpress handling permalinks properly it’s a done deal. Potentially nefarious SEO uses notwithstanding (grin), I’m mighty pleased by this.

Thanks Tom!

Also, I’m on vacation for a week starting tomorrow, and while I have several things in draft mode, nothing is ready to be auto-publishing while I’m away…though I may post-date one or two things.

Posted in Facebook, Twitter, geek, plugins | No Comments »

Automatically post friendly URLs to Twitter and Facebook

January 12th, 2008 Jason

In a fit of self-propagation, I set about this week to explore making Wordpress post to my Twitter any time I update.

I found a basic, but functional, plugin called Twitpress, which does exactly what I wanted. Except…I’m also using the All In One SEO Pack, which rewrites page URLs into an SEO-friendly format. (Really, a must-have plugin.) Twitpress by default will tweet the stock version of a post URL:

http://RelevantText.com?p=24

instead of the format I want to show:

http://RelevantText.com/making-the-most-of-server-errors-20080111/

Now, I know that a)Twitter links are nofollowed, so this doesn’t really matter for the spiders, and b)Twitter also automatically turns long links into tinyurls, but it still bothered me (more on why in a minute). So, I set about to fix the plugin.

After reading through what the plugin code was doing, I surfed through the WP database tables a little bit, and discovered that I needed to change one line in Twitpress. Hooray!

In the twitpress.php code, replace line 85:

$proto = str_replace("[link]", get_option('home')."?p=".$postID, $proto);

with

$proto = str_replace("[link]", $post->guid, $proto);

‘guid’ is a field in the wp_posts table, if you care.

Bingo. I’m very pleased with myself.

So why, you may ask, do I care about how the links look in Twitter if they aren’t spiderable? Because I’ve also installed the Twitter App on Facebook, so any time I update Twitter, my Facebook status updates as well…which means the link is then being pushed out along the newsfeeds of all my contacts there. The link is still not spiderable, but it is potentially much more likely to get seen, followed, and possibly linked to. Through the tinyurl redirect, it now goes to the right version of the URL, and when people subsequently link to the post, I want them using the right one. This, I think, will help that along.

Jan 14 Update: After my initial excitement, I’ve discovered that this is still slightly buggy - notifications occasionally appear on twitter with the p= URL, and sometimes with no URL at all.  This seems to only happen when a post is first published, and not when later edited, but I’m not clear why, as the ‘guid’ field is populated with the first publish of a post. So, this is cool when it works, but I’m still looking at it. 

Posted in Facebook, Twitter, geek, php, plugins, seo, site, wordpress | No Comments »