Guess what the most played song on Songza is?

image

A new music site launches, so what do people use it for? Rickrolling of course!

I’m liking Songza, it’s got a slick interface.  I can do most things on the page with AJAX, so I can keep listening while I line up other songs to play.  The speed is good & the audio sounds like standard MP3 quality.

You can register for an account now, here’s my profile. You can share the songs you find, the site gives you links to Twitter the songs, email them or embed them in your own site.

image

Here’s some Jonathan Coulton for your audible pleasure:

Continue reading

FriendFeed Comments WordPress plugin1.4 release

I’ve been a bit inspired over the last week to do some fairly major updates to the FriendFeed plugin.  Thanks to some helpful suggestions and feedback from a number of people, I’ve added a bunch of new features and fixed some dodgy code that was in the previous versions.

The biggest change is that you can now comment & ‘like’ a post directly from the post itself without having to go to FriendFeed.  This is done using a bit of AJAX (via Prototype). The user puts in their comment, their username & their FriendFeed API key.  The API key is never visible to the site owner, it’s passed directly through to FriendFeed and then discarded.

image

This form is turned on by default, but can be disabled in the admin section if you don’t like it. Also, because of this change, the plugin will now display on every post, whether there are comments or likes on it or not.

The other changes are:

  • You can now edit the ‘headline’ text that displays. ie the "On FriendFeed, this post was liked by x people and commented on y times".  You can now put whatever you want there, and it will replace the tokens {comments} & {likes} with the number of comments & likes.
  • A default stylesheet is now included, to get you started on styling the plugin’s content.  It also can be disabled in the admin page, and you can see what the stylesheet looks like here.
  • The plugin can now be set to have the FriendFeed comments & likes be visible by default.  Currently the default is to hide them and only show them when the user clicks the ‘show’ link.
  • Also, based on the points I made in my post about self-cleaning WordPress plugins, the admin page now has a ‘delete plugin’ button.  This is will remove all trace of the plugin from the WordPress database, so you can then deactivate the plugin knowing it hasn’t left anything behind.  Needless to say, only use this if you want to completely remove the plugin, not just disable it temporarily.
  • Numerous bug fixes & tidy-ups.  I’ve replaced my bespoke javascript to hide/show the comments with Prototype too.

So, if it hasn’t already turned up in the Automatic Updates list, grab the new version from here.  As always please let me know what you think & how it can be better.

Bookmarklet to search of the selected text on FriendFeed

Nicole Simon posted a request on FriendFeed for a bookmarklet that would search for the selected text on a page, so you could find who posted it first on FF.

I tried posting a reply on FriendFeed, but the comment kept breaking the url, so here it is again.  Drag this link onto the browser toolbar & it’s all yours.

Find on FriendFeed.

Best thing though is that Aviv posted a comment saying that this will soon not be needed:

No need for a bookmarklet… a "Find others" button is coming ;)

Sweet!

Writing self-cleaning WordPress plugins

Don’t you just hate it.  You install a program on your computer to try it out, then when you go to un-install it, it leaves files scattered all over your system.  Whether it’s in the application folder that it can’t delete, or in the Application Data folder or system32, it’s not easy to find a program that cleans up after itself properly.  I’ve got more of a chance of getting my kids to tidy up the lounge room after they’ve got all the Lego out.

This issue isn’t just limited to Windows applications though.  I’ve noticed the same problem with a lot of WordPress plugins.  It may just be leaving a couple of config options in the wp_options table, or it may be as much as leaving multiple custom db tables behind or even files in the WordPress install folder.  I’m of the opinion that once you remove a plugin, it should be gone without a trace.

Now, for plugin developers, WordPress provides a simple way to do this.  The register_deactivation_hook() method lets you register a function to be called when your plugin is deactivated.  In there you can put any cleanup code to remove options, tables files, etc.

But…

This is not without it’s problems.  Often plugins require you to enter some complex config information or they may build up a history that you may not want to lose (eg. a spam filter that learns from what you mark as spam).  Sometimes you need to disable plugins temporarily, in fact the WordPress update instructions say that you should deactivate all your plugins prior to upgrading.

Also, the automatic plugin updates system introduced into WordPress deactivates plugins before it installs the updated version.  So if you put the cleanup tasks into the deactivation hook method, all the user’s settings would be gone after updating.  This really isn’t a good option.

What would be better is if the WordPress plugin admin page had 2 buttons for each plugin: deactivate & uninstall.  Deactivate would do what it does now – turn off the plugin, but leave it in place.   Uninstall would completely remove the plugin, including deleting the plugin file & firing a separate uninstallation hook callback.  Developers could then put all their cleanup code in there, with no fear that users were going to lose settings during an upgrade.

What to do for now

I think for the time being it would be best if developers included a ‘remove all data’ button on their plugin’s options page (if it has one).  This button would remove all trace of the plugin (other than deleting the plugin itself) so that the user can then deactivate it.  This button should probably be restricted to admin users and have some form of confirmation on it. I’ve added a button to do this in the latest release of the FriendFeed Comments Plugin.

There’s already a post about this ideas section of WordPress.org, and a discussion about it on Weblog Tools Collection.  I’m hoping that this gets noticed, because it would be great if developers had a simple way of tidying up after themselves.

If this is something that matters to you, please go vote up this idea on WordPress.org.

Keeping the conversation civil

Jayne: Little Kaylee here just wishes you was a gynaecologist.
Mal: Jayne, you will keep a civil tongue in that mouth, or I will sew it shut. Is there an understanding between us?
Jayne: You don’t pay me to talk pretty. Just because Kaylee gets lubed up over some big-city dandy doesn’t mean…
Mal: Walk away from this table. Right now.

Simon: What do you pay him for?
Mal: What?
Simon: I was just wondering what his job is – on the ship.
Mal: Public relations.

Firefly – Serenity

The ‘social web‘ has brought many things to us, but possibly the most pervasive thing it’s brought is the ability to (and the general assumption that you should) comment on just about any piece of information published. Blogs offer this as a matter of course, but many news organisations are introducing the ability to comment on their articles.

By and large this is a good thing, people want to have their say. Also, for companies, engaging with your customers can be a sure-fire way of getting repeat business.  The wide-ranging discussions on the web, as they flow from site to site (see TechMeme) can be a great way to get a lot of different perspectives on a topic.

However, there can be a downside to allowing comments on your site & I’m not just talking about the usual gripes of spam & trolls.

Continue reading

FriendFeed Comments WordPress plugin 1.1 release

FriendFeedI bit the bullet & updated the FriendFeed Comments plugin to version 1.0.  I then noticed a couple of other things I needed to do, so I immediately updated it to 1.1.  So lets just say we skipped 1.0 Ok?

No real functionality changes, just a bit of housekeeping and admin tweaks.  The plugin will now warn you if you haven’t entered a FriendFeed nickname in after activating the plugin.  Also, after saving your nickname on the options page, it puts up a reminder to put the <?php wp_ffcomments(); ?> tag in your single post template.

So get it running & let me know what you think!

A few updates for the FriendFeed plugin

Thank you to everyone who’s installed the FriendFeed plugin.  The feedback has been very helpful. I got svn access for the WordPress Plugin hosting, so the plugin now exists on the WordPress plugins site.  The upshot of this is that it will now be included in the WordPress automatic updates, so if your version of WordPress supports that, you should start seeing updates for it on your plugin pages. 

Speaking of updates, I’ve just checked in an update that shows the likes as well as the comments.  So you will now get a list of the people who ‘liked’ your post as well as the comments. I’ve also tweaked the HTML it generates a bit, so if you’d setup some CSS rules around the plugin, you might want to check they all still work after updating.

image

I’ve got some default styling rules that you can apply to get started, otherwise the plugin is just going to give you two vertical lists, which probably isn’t what you want

#togglefriendfeedcommentslink { color: #333; font-size: 10px; font-weight: bold; }
#friendfeedicon { float: left; border: none; padding: 0 4px 0 0; }
#friendfeedlikeslist ul, #friendfeedlikeslist ul li { display: inline; }
#friendfeeddiscussions { margin: 10px 0 0 0; clear: both; }

Can I recommend the Cross-theme Stylesheets plugin to make this simpler.  You can create a stylesheet just for this plugin that can be edited inside the WordPress admin section, independent of the theme’s styles.

Update: Just got my first TechCrunch link!

FriendFeed Comments WordPress Plugin

Well, FriendFeed released their API yesterday, along with pre-written php & python libraries.  It’s a really good API, got access to all the data you see on the site.  So I’ve written up a WordPress plugin that will pull back comments from FriendFeed & show them on your site.  This plugin will allow you to display on your own site the comments that people make on FriendFeed about your post. 

I keep trying to think of a more succinct way of writing that but I can’t.  I always sounds more confusing than it is. See the plugin page for more details, this is an early beta I can’t stress that enough.  It will have bugs, it may very well break. 

image

Anyone who is willing to help beta test would be very welcome, you can download the zip file here. Unzip that into your plugins folder & activate it.  You’ll then need to go into the options (or settings if you’re running WP2.5) and click on FriendFeed.  Put your FriendFeed nickname in & save.  You’ll then need to drop the new template tag <?php wp_ffcomments(); ?> on to your single post template somewhere inside ‘the loop’.  I put mine just above the <?php comments_template(); ?> call.

Much thanks to Corvida for being my first guinea pig tester.  It seems to be working on her site, and she gets a lot of comments! 

Google's moving in next door

image Google really is busy here in Australia.  First they announce Transit for Perth (and other states to come soon), and now I hear they’re building their new headquarters next door to my office.  They’re currently across Darling Harbour from us over in Darling Park here, but they’re moving here. It looks like a big block of concrete there, but it’s actually a construction site now.  Pyrmont is turning into a media hub, with Channel 7 next door too, and a whole bunch of other small media agencies near by.  Channel 10 is just up the road too.

The new Google building is been billed as a new ‘green’ style of building, apparentlyWorkplace6, a joint venture between site owners GPT and builder Citta Property Group, will generate one-quarter of its own power supply, take in harbour water to release heat and recycle sewage to flush toilets and irrigate nearby parks”.  Makes sense, sounds like Google is expanding its solar power scheme. Wonder if we’ll get a monitoring page like that for Sydney.

 This Lifehacker article has an image of what it’s going to look like.

Sydney’s Googlers will move into the new building in 2009. The press release was long on “dull but worthy” details such as “Workplace6 is NSW’s first 6 Star Green Star building, going above and beyond green office standards for Australia.”
We can only assume from the brevity of the press release that Google Australia has conceded that Google Zurich – which features a fireman’s pole or a slide to get you down to the  ground floor in a quick and  fun fashion – reigns supreme as the “cool” Google office. Aww.