Most read posts this month



Feb 16th 2009 × Masking your email address from links to prevent data capture by bots

It’s annoying. There are sorts of crawlers that fetch all sorts of emails from websites and then sell the lists to Chinese and Russian spammers. I believe another term for this is harvesters… Yet, we do need to leave users a means of contacting the site owner / admin / customer service rep. The solution? Javascript / mootools can fix this with 3 lines of code, making it impossible for a crawlers to identify an email address and yet the mailto: link will remain fully functional to the browser.

As usual, stick this in your mootools domready function:

// hidden emails
$$("a.mailLink").each(function(el) {
    el.set("href", "mailto:" + el.get("data-user") + "@" + el.get("data-domain") + "?subject="+ el.get("data-subject"));
});

Now, whenever you want to place a mailto: link, format it like so, assigning it the mailLink class:

<a href="mailto:" class="mailLink" data-user="christoff" data-domain="gmail.com" data-subject="link exchange">mail me</a>

We are using element storage behind the data- name space in the style of HTML 5, joining the different parts of the mail address together via javascript. Of course, should you wish to, you can opt for using the title=”" tag and use JSON instead, allowing you to keep to older doctypes, something like this:

<a href="mailto:" class="mailLink" title="{user:'christoff',domain:'gmail.com',subject:'link exchange'}">mail me</a>

You’d have to adjust the script above to process the JSON and to revert the title attribute to something more readable:

// hidden emails, dependencies: JSON
$$("a.mailLink").each(function(el) {
    var mailProperties = JSON.decode(el.get("title"));
    el.set({
        "href": "mailto:" + mailProperties.user + "@" + mailProperties.domain + "?subject="+ mailProperties.subject,
        "title": "Send a mail to "+ mailProperties.user + "@" + mailProperties.domain
    });
});

I hope this helps you somewhat.


Jan 30th 2009 × Fit Flops – not really a flop?

This is kind of off-topic, but I can barely contain my laughter. I am a natural sceptic so when my wife told me of shoes that ‘exercise’ you as you walk, I just slapped my forehead… Even so–I decided to check this out–we contacted my old friend Alex over at Shoe Envy and asked her what all the Fit Flops hype was all about (the marketing malarkey that women buy into and all that). To my surprise, she actually said they were ‘cool’ and did give you a workout as you walked.

Well, seeing as it’s winter, we decided to chance it and ordered the FitFlops Billow Boots for her… at £69.95, Shoe Envy are by far the cheapest online Fit-Flops retailer I could find, so it got our cash… And off she goes–all smiles–with Mikaela on a walkabout in the park… Saying how she ‘feels’ her muscles ‘puffing’.

3 hours later, she’s back home, complaining of a reasonably acute muscle ache, hinting over foot massages and whatnot! You’d think that if your shoes tire you needlessly and leave you worse for wear, you’d ditch them, wouldn’t you? I certainly wouldn’t go around pimping them to other gullible women… Not my wife! Anyway–if you want to exercise your loved one without telling her so, get her a pair of Fit Flops and smile knowingly :D