Alex King’s Twitter Tools Plugin is a must if you are a WordPress Blogger and Twitter user. It’s most compelling feature is that it can automatically post a Tweet when you post a new blog post. This also works for time delayed posts, it Tweets when the post is published. One of the things I didn’t like about it was that it prefixed every blog post with “New Blog Post: “ which is a sure fire way to make sure more than half your followers don’t click it.
The thing is, you have already said what you want to say in your title hopefully, so how about we just Tweet the title and a link? Changing this code comes with one dire warning, you have to keep something in the prefix, that’s how the plugin finds Tweets to create the digest post, so instead of “New Blog Post: “, I am going to change mine to just “BP “.
Editing The Code
There is one class in the source code that defines the settings you can’t change in the UI, that class is called “twitter_tools.” Lines 18-27 define UI items, and 29-36 are supposed to not be end user editable, but we aren’t going to let that stop us.
1: class twitter_tools {
2: function twitter_tools() {
3: $this->options = array(
4: 'twitter_username'
5: , 'twitter_password'
6: , 'create_blog_posts'
7: , 'create_digest'
8: , 'digest_title'
9: , 'blog_post_category'
10: , 'notify_twitter'
11: , 'sidebar_tweet_count'
12: , 'tweet_from_sidebar'
13: , 'give_tt_credit'
14: , 'last_tweet_download'
15: , 'doing_tweet_download'
16: , 'doing_digest_post'
17: );
18: $this->twitter_username = '';
19: $this->twitter_password = '';
20: $this->create_blog_posts = '0';
21: $this->create_digest = '0';
22: $this->digest_title = __("Twitter Updates for %s", 'twitter-tools');
23: $this->blog_post_category = '1';
24: $this->notify_twitter = '0';
25: $this->sidebar_tweet_count = '3';
26: $this->tweet_from_sidebar = '1';
27: $this->give_tt_credit = '1';
28: // not included in options
29: $this->update_hash = '';
30: $this->tweet_prefix = 'New blog post';
31: $this->tweet_format = $this->tweet_prefix.': %s %s';
32: $this->last_digest_post = '';
33: $this->last_tweet_download = '';
34: $this->doing_tweet_download = '0';
35: $this->doing_digest_post = '0';
36: $this->version = '1.0';
37: }
Lines 30 and 31 are what we are concerned with. Line 30 defines the Tweet Prefix. On my blog I changed this to just ‘BP’ to shorten it and get me back some characters. Line 31 defines the format string for the post, I also wanted to get rid of the colon, so I changed it to read:
$this->tweet_format = $this->tweet_prefix.' %s %s';
That’s it, now when your blog publishes, it will post a Tweet that’s a bit more concise and looks more like you wrote it rather than an automation.
