Blacklisting words in Twitter Tools

There’s a new game trending on Twitter these days, Spymaster, and it likes to write out stuff to your twitter feed. There’s a good controversy running on the web whether these tweets are spam or not. I’m playing and I’ve set it up to tweet out only level ups which is pretty minimalist.

However, I am also running the Twitter Tools plugin to copy my tweets back from twitter to my blog. But if I’m fine with exposing my twitter followers with #spymaster notifications, I’d rather not show them to my blog readers.

There is no way currently in the plugin to exclude tweets based on words, so I made a patch for it:

blacklist in the twitter tools options menu

You can download the patch for the current 1.6 version and apply it with the following command:

patch twitter-tools.php < twittertools-blacklist.patch

I hope this feature will make it in the next version of the plugin.

Meta-tags proposal for the new DiggBar

Many think the DiggBar is evil. I don’t. I find it ingenious, especially the digg.com pre-pending which will automatically generate a shortened URL for you as well as a “Submit to Digg” button if the page URL has not been submitted yet.

prepending digg.com for the digg bar

unsubmitted diggbar

However, when you submit a link to Digg by this way, the title and description of the item are empty by default, placing the burden to fill up these fields on the submitter. He needs to go back to the page, copy the title, copy some text of the article or make up a better description, which is all a pain and poses a big hurdle…

Digg submission - all empty

Digg offers a way for webmasters to create a link that will pre-fill these fields with the data you want your readers to use. This is done by simply setting some parameter in a URL to put as target of the link:

http://digg.com/submit?url=example.com&title=TITLE&bodytext=DESCRIPTION&media=MEDIA&topic=TOPIC

But this process is not compatible with the DiggBar and its URL pre-pending feature. What we, webmasters, need is a way to define these values that will work everytime.

Why not Meta tags? Step 1 of the step 2 in the screenshot above is Digg downloading the page to check it really exists and provide potential thumbnails for the submission. At this stage they could read a couple of meta tags in the <head> of the page and use that to pre-fill these fields.

<meta name="digg-title"  content="My title here" />
<meta name="digg-description" content="My 350 characters excerpt." />

It would then be trivial to write a WordPress plugin that generates these meta from your post title and excerpt (or similar concepts in other CMS platforms).

If you think this would be a feature you would like to see, I invite you to digg this blog post: http://digg.com/d1p1YV

ctype_digit error in WordPress 2.5

wordpress-image-uploadI’ve upgraded my blog to WordPress 2.5 last weekend. The new design of the admin backend is great and seeing things evolve like that really motivates me to pour more time into my blog and add some nice little functionalities that I’ve been thinking about lately.

But it happens that I came upon an error when trying out the new image uploader and I’m sure many people will get it too:

PHP Fatal error: Call to undefined function ctype_digit() in wp-includes/link-template.php on line 182

What happens is that my flavor of PHP5 is not compiled with the ctype flag. This seems to be the default on Gentoo, so if you run it be sure to add the ctype use flag to your portage config. But if you can’t recompile PHP, you can just open up the file wp-includes/link-template.php and replace the line 182 as follows:

Replace ctype_digit with is_numeric

That should do the trick until the version 2.5.1 that should patch things up according to what I see in the bug tracker (pending issue on link-template.php and a similar issue in another file already merged in 2.5).