Twitter Tools is an awesome plugin. I use it on multiple sites, including this one, to automatically tweet new posts.
While the “New blog post:” prefix is good for this site where I also do tweets of my own, it’s not so good for Twitter accounts that are only used for tweeting new posts, such as my FinalGear.com Twitter account. So here’s a tiny little plugin that will allow you to change or remove the prefix from the tweets that Twitter Tools makes.
<?php /* Plugin Name: Twitter Tools Tweaks Description: Makes modifications to the automatic tweet format of the "Twitter Tools" plugin. Author: Viper007Bond Author URI: http://www.viper007bond.com/ */ add_action( 'init', 'TwitterToolsTweaks', 15 ); function TwitterToolsTweaks() { global $aktt; // Some examples of what you can do that have been commented out by "//". // Remove the slashes from the beginning of the line to enable that line. // Changes the prefix // $aktt->tweet_prefix = 'Check out my cool blog post'; // Changes tweet format to: "PREFIX: URL - TITLE" // $aktt->tweet_format = $aktt->tweet_prefix . ': %2$s - %1$s'; // Changes tweet format to: "TITLE URL" // $aktt->tweet_format = '%1$s %2$s'; } ?>
Copy/paste the above into a text file (enable plain text mode first if need be) and then rename it to something.php
(twitter-tools-tweaks.php
will do) and stick it in your plugins folder. Activate it and you’ll be good to go.
thanks for your posting its very help on me, happy blogging
Viper, When I comment out the slashes activation of the plugin triggers “fatal error” on that edited line. ???
Why not just edit line 171 in the twitter tool php file?
The wordtwit plug-in allows you to enter anything you want through its admin.
Pablo DiCiacco on May 11th, 2009 at 9:32 PM wrote:
Because then you have to redo it when you upgrade.
Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
^what did i do wrong?
Pingback: Twitter Updates for BuildingOnlineBiz.com
Alex,
Thanks for the great entry and I like your approach.
Any suggestions on how to add a prefix to the post_title within Twitter Tools? I’d like the title for my tweets to be appended with something like “Twitter Feed:” when they appear in WP.
Pretty sure that’s built into Twitter Tools now.
Pingback: I just optimized my #wordpress… | Intesyo
this no longer works. i uploaded the plugin and it worked great until I kept getting an upgrade notice. Once I upgrade, the plugin disappears. and goes back to the prefix.
No dice on this one. Looks like Alex pulled a fast one.
Just visit the settings page. He has since added a UI for the feature. 🙂
actually, i dont think that the UI lets us remove the prefix entirely. I would like to have it take my blog title, for example, The Blue Man Jumped Off The Wheel. But if I update the plugin, it removes your plugin and then the prefix comes back as:
: The Blue Man Jumped Off the Wheel
I dont want any extra characters. So to make this work, I have to leave your plugin there and not update for now.
Not sure. I stopped using Twitter Tools a while back as I use YOURLS now.