Winning Against Comment Spam

Also today I installed Steve Smith of OrderedList.com’s FeedBurner plugin to redirect all my feeds to FeedBurner. It was a simple setup and it’s effective, and lots easier than going and manually setting everything up. Thanks, Steve, for another great plugin to go along with your amazing Wordpress Tiger Admin theme!

Incidentally, has anyone upgraded to Wordpress 2.0 yet? I’m using a very recent version, but I haven’t upgraded to the big “2.0″ yet. I’m thinking I need to wait just a little bit longer for all the plugins to get updated and be compatible with version 2.0, huh? I should really check, because I don’t even know how they revamped the plugin system in 2.0 (or if they have revamped it).

Well, that’s all for now, folks. Toodles!

Update (Thurs. Feb 9th) — As of today, Akismet has caught 205 spam comments!

January 9th, 2006 | 3 Remarks

Blogliner 0.3

The changes probably won’t affect most users, but for those of you who’ve subscribed to blogs which have ampersands in their URL, you may have discovered that your HTML page is invalid. This is something I hadn’t thought of previously, due to the fact that I’ve never subscribed to a blog whose default location contained an ampersand (usually the default location is the domain name, for example blah.com).

Dave brought it to my attention, and thanks to him, I’ve issued this fix.

You can still download and install the plugin at the same location, so if your plugin is producing invalid HTML, it’s time to upgrade!

November 28th, 2005 | Remark

Battling Comment Spam

The preemptive measures I took were things like a simple blacklist of keywords that were almost definitely spam and moderating comments that contain three or more links. Evidently that was failing as well, so I began searching for a plugin.

Recently I found that Michael Heilemann uses Akismet as his comment spam plugin. According to him, it is his first-ever comment spam plugin and works like a charm. That’s a good enough testimony for me. I proceeded to download it, only to discover that I needed a Wordpress “API key.” What the?

It turns out, in order to use Akismet, you have to register for a blog at Wordpress.com. How do you do that? There’s no “register here” place or anything. I typed my email in the invite box and received an invitation a few hours later. That gave me the ability to register. Man, all that just to register. Good grief!

Anyway, so if you’re wondering how to get an API key, you have to get invited to Wordpress.com and sign up there, then go to your profile and copy the API key. The Akismet plugin works absolutely beautifully and has thus far caught 8 spam comments (all of which were indeed spam, by the way). I only installed it yesterday. Thanks, Akismet!

November 17th, 2005 | 9 Remarks

Blogliner 0.2

You can grab the ZIP and overwrite your older version via cut/paste.

The only thing new in this version is that you have an option to display folder titles as list item headers when you show all folders. Enjoy!

September 22nd, 2005 | Remark

He’s Speedy!

Basically this is a bug-fix update. People have had problems with using this plugin with the default Wordpress theme, so I modified the plugin so it’s compatible. It’s not pretty, but it’s compatible — you can use the thing now.

So, grab the script or the zip. Enjoy!

August 25th, 2005 | 5 Remarks

Show Plugins in Your Sidebar

Now, to make this thing show up in my sidebar instead of in the footer, we don’t need a great deal of modification. Step one is to go to modify the plugin in your Plugins → Plugin Editor panel. When you select the Show Plugins plugin, the source will come up in a textarea and you can make changes to the plugin’s code. Simple enough, so what’ve we got? At the very bottom, you’ll notice this:


// Use object to avoid namespace collisions
$show_plugins = new Show_Plugins();
// We want to modify the meta section
add_action('wp_footer', array(&$show_plugins, 'wp_footer'));
// There is no action hook for "start of processing",
// so we use this implicitly.
$show_plugins->start();

The problem, obviously, is that it’s running this plugin in the footer. We don’t need any of the above code, so delete it. The start() function is empty, as you may have noticed, so we won’t be needing that, either. Delete it, too. Now we’re left with two functions, wp_footer() and get_plugin_data(). Rename wp_footer() to start() to avoid any possible compatibility issues (though I doubt it would be a problem, since this function is run within a class and is therefore a private function as opposed to a public one).

Now let’s make some changes to the start() function (which we renamed from wp_footer()). The end of the function is where an echo statement is, indicating HTML output. However, we want an unordered list… Right? (If not, skip this part.) Take a look at the following code.


echo("<div class=\"show-plugins\">" .
__("Plugins: ") .
join(', ', $plugins) . "</div>");

Change the above to something more elegant, like what I’ve done below. (Note that I’m referring to the output rather than the actual PHP code when I suggest that the solution is more elegant.)


echo(' <ul class="show-plugins">'."\n".' <li>'.
join('</li>'."\n".' <li>', $plugins).
' </ul>'."\n");

You’re done modifying the plugin! Save that bugger, and go to the Presentation → Theme Editor panel. Make sure you’re modifying the correct theme (the one your site’s using, or more than one if you have a theme-switcher) and locate the file you use for your sidebar to edit it (in the default theme, Kubrick, I believe the file is named “sidebar.php”). Decide where you want this list to appear, and place the following code in that place.


<?php
$show_plugins = new Show_Plugins();
$show_plugins->start();
?>

All the above does is creates a new Show_Plugins class and calls the start() function to output the HTML we want. You can use any kind of list in any kind of format. I did exactly what I showed in this blog entry (in the sidebar, I added an H3 that says “Wordpress Plugins”), so it should work for any Wordpress blog running WP 1.5 or greater. Hope this helps some of you folks out there!

June 18th, 2005 | Remark

Where Is It?

There’s something wrong with this picture, because I know awhile ago that I saw it. I didn’t have time to install it then, but I’m really interested in getting that Wordpress plugin that automatically lists the installed/active Wordpress plugins currently being used on the site… Can someone tell me where it is? There’s no reason to reinvent the wheel.

June 17th, 2005 | Remark

Speedy Cat

When I begin writing an entry, I start with the entry title, the entry tags, the excerpt, and then I type the post. Usually, after I’m done, I decide what category (or categories) the entry belongs in. The problem is, sometimes none of the categories are applicable, so I have to create a new one. If I want to create a new category, I don’t just have to open a new tab to reserve all that I wrote, but I have to go from Manage to Categories to Add New Category, type the Category, submit it, and then close the tab. On top of all that, you have to refresh the page where you’re typing your post to check the new category’s checkbox, meaning you could potentially lose everything you already typed! Well, you’ll be relieved to know that you don’t have to do that anymore.

Introducing SpeedyCat, the quick way to add categories to your blog. SpeedyCat adds a small “Add Category” section below the “Post Password” section in the sidebar of the admin interface. There’s only one field, and an “Add” button. You type the name of the new category, and hit “Add,” and bam! The field is cleared, JavaScript sends a request to add that category to the database, and a new category appears at the end of the list of existing categories (already checked for you!). Adding categories to Wordpress has never been easier!

Setup and install is easy as one, two, three… four, five: grab the plugin source (or download the ZIP file containing the PHP file and a readme), save it as a PHP file (or extract the PHP file from the ZIP archive), and upload it (the PHP file) to your /wp-content/plugins/ directory, run over to the Plugins panel of your admin control panel and activate the “SpeedyCat” plugin, and go to the “Write” panel to test it out! What do you think?

Oh yea, a note to Opera users: this plugin may not work for you, since Opera doesn’t support XMLHttp requests. It will work in any browser with JS disabled (it degrades gracefully), but obviously the functionality is very limited in that case. For IE and Firefox users, though, everything should go smoothly.

Update (8/25/05): I updated Speedy Cat to be compatible with the default Wordpress theme.

June 15th, 2005 | 24 Remarks

Introducing BlogLiner

In the past, I’ve used a bookmark synchronizing Firefox extension to upload an XBEL (XML) file to my web site each time I opened or closed Firefox. Everything worked great, but the number of bookmarks I had was getting very large very quickly, and uploading/downloading the XBEL file took longer and longer. It also took longer to load Firefox due to the amount of bookmarks it had to load on startup. Finally, I got fed up with it. I started searching for some sort of way to efficiently manage all these bookmarks and get the content I wanted to read on a daily (or even hourly) basis. Guess what I found…

Introducing Bloglines

A colleage of mine, Matt, posted an entry with a link that explained how to use Bloglines to keep track of my bookmarks. Skeptical but interested, I visited. Much to my surprise, Bloglines didn’t just look good, but it worked extremely well! I had expected it to be another run-of-the-mill, nothing-extraordinary service that I would end up forgetting about later on, but that proved not to be the case.

The tutorial helped me get a jumpstart on just why the site exists, to begin with. It’s not del.icio.us part 2, like I had previously thought. It is more of an RSS aggregator with a massive heap of features at your disposal. I highly recommend you sign up and at least give it a shot. If you think your Firefox Livemarks are sufficient, think again. When you get about 90 or more RSS feeds, you’ll know exactly what I’m talking about.

The API

One of the “big things” going around right now is APIs. Amazon has one, Google has one, eBay has one, and Bloglines has one. (Other sites have them, too, but those are the popular ones that come to mind.) The powerful thing about APIs is that they give developers access to cross-site information, which is very important for any site like Amazon, Google, eBay, or Bloglines. Equipped with an API, we can take information that we work with and store elsewhere and process/utilize that information on our own site. You have to agree, this is extremely convenient.

With Bloglines, you can take any username (and optionally any folder), and output them in an HTML format. Have a look at mine (or just my blogs folder). Awesome! Now we can just run a PHP include to get that HTML output on our site, right?

The Problem

Unfortunately, there is a slight inconvenience with the output result that we get from Bloglines. The output is a bunch of DIV’s! We know that this should obviously be an unordered list and not a bunch of DIV tags. This means that a simple “include my blogroll” won’t be sufficient if you want your web site to stay semantically correct. Additionally, you may wish to only output a specific number of blogmarks at any given time. The API doesn’t permit this (although you can separate a specific number of blogmarks in another folder at the Bloglines web site, it is not as convenient to create so many folders).

The Solution

Introducing BlogLiner (yes, you read that right: BlogLiner). What does BlogLiner do? It’s a Wordpress plugin that makes the Bloglines output into a pretty unordered list. Results are output exactly as you order/manage them on the Bloglines web site, so you manage your blogmarks as you would normally, and they’ll be output the same way on your blog. Oh, and yes, you can output just one folder or every folder you have on Bloglines. The only requirement is you have to have Wordpress to use the plugin. (If you’re a tricky fellow, you might take the source code and modify it to work in your own blogging software, though.)

Installation

First, download BlogLiner, unzip it, and upload the PHP file to your /wp-content/plugins/ directory. Then login to your Wordpress admin area and activate the plugin. Click the “Plugin editor” tab, select to edit the “BlogLiner” plugin, and change the settings appropriately. The four settings are your username, the folder you want to show as your blogroll (if you want to show all folders, leave the second variable empty), whether or not you want to show your support for Bloglines by including a link back to them at the end of the blogroll, and how many new blogroll entries you want to display. After you’ve done that, go to your theme editor and decide where you want to output your blogroll. Just pop this code there, and hit the update button:

<?php bloglines_roller(); ?>

You’re Done!

That’s it! There’s nothing more to it, thank goodness! Enjoy it, report bugs, suggest features, and let me know what you think about it!

Update!

I’ve updated the ZIP file. BlogLines now supports a URI-type command so that you can not only specify default settings, but override those settings by sending variable/value pairs to the function via var=value&var2=value2. There are examples in the new BlogLines.php plugin file of how to use it. Enjoy!

Update Again

I know it’s kind of obvious, but I just wanted to note that this extension is available for Textpattern, thanks to Bob.

Another update

I updated the plugin to version 0.2. There’s only one new feature, and that is folder titles appear when all folders are displayed.

May 5th, 2005 | 44 Remarks