Gregg Hilferding


del.icio.us Isn’t It?

Because I chose toyed with the idea of using the very chic Japanese Cherry Blossom template, I was introduced to the del.icio.us bookmarking site yet again. The difference between this time and the last dozen or so times I've run across it? This time I signed up and converted.

The idea of moving my bookmarks online has been nagging at me for almost a year so it's good that I had an excuse. :)

Bad News

The bookmarklet provided during the sign up process (v3) and the one I downloaded from the help section (v4) both failed to work in Safari. Each threw a syntax error.

Bad Bookmarklet v3:

javascript:location.href='http://del.icio.us/post?v=3&url='+ encodeURIComponent(location.href)+ '&title='+encodeURIComponent(document.title.replace(/^\s*|i\s*g,''))

See the problem? The regular expression in the title.replace bit is missing the closing "/" plus it has the critical flaw that it removes all the spaces from the entire title, Not just the ones at the beginning and the end.

Bad Bookmarklet v4:

javascript:location.href='http://del.icio.us/post?v=4;url='+ encodeURIComponent(location.href)+';title='+ encodeURIComponent(document.title.replace(/^\s*|\s*g,''))

Same problem here, the only difference between versions is that this passes the variables via javascript instead of in the URL. Probably to deal with extraordinarily long URLs and titles breaking the maximum character length of the URI field.

Corrected Code (Just for fun, I'll call it v5):

javascript:location.href='http://del.icio.us/post?v=5;url='+ encodeURIComponent(location.href)+';title='+ encodeURIComponent(document.title.replace(/^\s*|\s*$/g,''))

Here we go! We've added our closing "/" and dropped in the dollar sign into the second condition to mean "only remove extra spaces from the end of the title."

Oh right, the link

Gregg's Bookmarks

Published by Gregg Hilferding on October 14th, 2006 at 3:46 pm. Filed under Administrative, Javascript2 Comments

Wordpress Plugin Choices

This is one of those posts that you don't care about, but will be very handy for me later. :)

Comment Spam

  • Akismet Why? Because it's bundled with Wordpress, silly.
  • Challenge I loath the idea of using a CAPTCHA because of accessibility concerns. I chose Challenge over other plugins because it allows me to provide PHP eval'd questions of my own. Once the bots get smarter at reading the standard question, I can generate my own variations.

Formatting

Fancy Shmancy Stuff

  • IP to Country I still get excited when I realize that the people I am conversing with online (through forums, blogs, email, whatever) are from all over the world. :)
Published by Gregg Hilferding on October 14th, 2006 at 12:42 pm. Filed under AdministrativeNo Comments

First Post

Wordpress really is much easier to install than Movable Type, and the admin section is much easier on the eyes.

What's left to do? Add some comment spam plugins, jazz up the template, and post some entries. :D

Wondering what the entries will be about? This isn't going to be one of those blogs that has a highly focused niche topic like "news and commentary for red fuzzy widget enthusiasts." My only productive goal is to maintain a repository of solid PHP and regular expressions code snippets. Not for you my reader mind you, but for myself as I am constantly losing and rewriting code.

Beyond the technical, you can expect the occasional rant about SEO or Search Engine Marketing, frank discussions about choices I make every day about website usability and design, and the occasional link to an unusual site. Everything will be neatly categorized and you can always just subscribe to the category feed that interests you. (If wordpress doesn't allow this already, I'll be hacking together a plug-in to do so.)

Published by Gregg Hilferding on October 14th, 2006 at 11:10 am. Filed under Administrative1 Comment