Post to Twitter when you post to your blog
Filed Under Internet, Social Networking, Twitter, Wordpress |
I don’t like doing things manually when I can have software do my bidding. Usually I’ll send a twitter when I have a new blog post on here that I think people are interested in. (I recognize not everyone has my RSS feed in their feed reader…yet) But it’s a manual process and an extra step, so I went out and found Alex King’s Twitter Tools plugin. Alex King is a name forever associated in my head with Wordpress, primarily for his help in finding themes back in the early days of WP. This plugin is pretty full-featured:
- Archive your Twitter tweets (downloaded every 15 minutes)
- Create a blog post from each of your tweets
- Create a daily digest post of your tweets
- Create a tweet on Twitter whenever you post in your blog, with a link to the blog post
- Post a tweet from your sidebar
- Post a tweet from the WP Admin screens
- Pass your tweets along to another service (via API hook)
I’ve currently got it set up to send to twitter when a post goes live on here. So in theory, when this post went live, it should have shown on my Twitter page.
UPDATE: Looks like Twitter Tools will post any edits to a posts if that blog post has not been twittered yet. Sorry for the twitter flood when I removed the “Uncategorized” category from a couple old posts. I’m going to look into manually adding the “twittered” metadata to all my posts so it doesn’t happen again.
UPDATE 2: Threw together a quick little php script to update the database so old posts aren’t twittered when they’re edited. YMMV, User beware, no warranty, etc. You’ll want to make a backup of your databases, then fill in your username, password, and database_name and then run this either from command line or via the browser.
/*--------code start--------*/
mysql_connect(localhost, "db_username", "db_password");
mysql_select_db("database_name");
$res1 = mysql_query("SELECT * FROM wp_posts p WHERE (p.post_status LIKE \"publish\")");
while ($row = mysql_fetch_array($res1, MYSQL_ASSOC)) {
//find out if the TwitterTools metadata has already been written
$sql2 = "SELECT * FROM wp_postmeta WHERE (post_id = ".$row['ID'].”) && (meta_key LIKE \”aktt_tweeted\”) && (meta_value LIKE \”1\”)”;
print “Post ID: “.$row['ID'].” \n”;
if (!mysql_numrows(mysql_query($sql2))) {
//metadata not found, let’s fake it without twittering
$sql = “INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (”.$row['ID'].”,\”aktt_tweeted\”,1)”;
mysql_query($sql);
print ” — added metadata to fake it. \n”;
} else {
print ” — already been twittered. \n”;
}
}
/*——–code end——–*/
Image Upload Plugin for Wordpress
Filed Under Software, Tools, Websites, Wordpress |
I hate Wordpress 2.x’s handling of images. Yes, I said it. In fact this one feature has kept some of my blogs on Wordpress 1.x just because I like the plugin I found for uploading images and creating thumbnails all from a web interface, no need to load Photoshop. I just discovered that this plugin has been updated for Wordpress 2.x. They just made my day! (Yeah, I noticed, they’ve been compatible since 12/2005, but I never got the memo!) For all your bloggers out there using Wordpress 2.x that are frustrated with the image uploading and posting, I highly recommend checking out IImage Browser.
I do not like Internet Explorer
Filed Under Wordpress |
Due to IE not displaying the site correctly, we’ve moved back to a simple layout while we figure out what in the world is wrong. Everything displays exactly how we want it in Firefox, but in IE the side menus were missing, posts wouldn’t show, images wouldn’t low, and the digg buttons wouldn’t display. And then seemingly randomly, without any code changes, different parts of the front page would load. Quite strange and will require some muddling through the code to figure out why IE won’t play nice.
UPDATE: Ok, so it appears that the embedding of a Google Video is what broke things. We pulled it out of a previous post and all is well. I find it odd that Google would give me browser-breaking code. They should know better! Anyways, back to your regularly designed theme. :)