Coding with Jesse

5 Basic Search Engine Optimization Tips

Search Engine Optimization (SEO) has grown into an entire industry. There are tons of companies who do nothing except help web sites rank high on Google or get lots of search engine traffic. Most of these companies charge a lot for their services. I'm going to outline a few simple things you can do to your own site for free. This isn't a complete list of things you can do, but you can do very well on search engines by following all of these.

  1. Use a strong title

    Probably the most important place on the page for search engines is the <title>. Rather than cram a thousand keywords in your titles, try to keep them simple and to the point. Describe the contents of the page in plain language. For example, I titled this page "5 Basic Search Engine Optimization Tips" rather than "SEO For Dummies" or something else tricky.

  2. Pay attention to the URL

    The worst URLs for search engines are like "http://site.com/index.php?c=34&d=43". It's much better to use "http://site.com/my-web-page-title". Do everything you can to get the same keywords into the actual URL of your page. Also, make sure you separate the words by a dash "-" instead of an underscore "_". Google sees a dash as a space but sees words attached with an underscore as one big word.

  3. Use header tags appropriately

    Use <h1>, <h2>, etc. whenever you can. Don't use them to increase the font size, use them to mark your titles. Doing so tells search engines that these words describe the page or section of the page. So be sure to put good descriptive keywords into these tags. This will increase the page's relevance to those keywords.

  4. Keep all the words in the HTML

    A lot of sites have titles and navigation made up of image buttons and links. It's better to just use plain text with a background image. If you really want to put words into images, make sure you at least use the alt attribute. Also, try to put the same words in the HTML, hidden by CSS if necessary.

  5. Write good content

    This is an obvious one, yet usually forgotten. Good content will have a lot of keywords relating to the topic. By using lots of synonyms and clear descriptions, you'll give more words and phrase for the search engines to find. Even having user-generated content such as comments or reviews will give more opporunities for searchers finding the page.

Hopefully following these simple tips will help you get some more traffic. There are a hundred tips and tricks out there, but the best tip of all is to just write lots of great content and make good web pages which are useful and easy to read. The rest should come naturally.

Published on September 3rd, 2006. © Jesse Skinner

Working around "Click to activate and use this control"

As you may likely be aware, the latest versions of Internet Explorer and Opera have decided not to give Eolas any money for their patent. Instead, users are forced to click on plugins (movies, sound, Flash and Java applets). In other words, anything inside object, embed or applet tags.

Thankfully, there is a way around this. Microsoft has documented some workarounds. I've put together a solution here that works in Opera as well:

// only execute code if 'getElementsByTagName' and 'outerHTML' are supported
if (document.getElementsByTagName && document.body.outerHTML) {
    // repeat code for each affected tag
    var tags = ['object','embed','applet'];

    for (var i in tags) {
        // get all elements with tag
        var objs = document.getElementsByTagName(tags[i]);

        for (var j=0;j < objs.length;j++) {
            var obj = objs.item(j);

            // find param tags within object
            var params = obj.getElementsByTagName('param');
            var inner = '';

            // if there are params, but param tags can't be found within innerHTML
            if (params.length && !/<param/i.test(obj.innerHTML))
                // add all param tags to 'inner' string
                for (var x=0;x < params.length;x++)
                    inner += params.item(x).outerHTML;

            // put 'inner' string with param tags in the middle of the outerHTML
            obj.outerHTML = obj.outerHTML.replace('>', '>' + inner);
        }
    }
}

Download this script here.

The code only executes on browsers which support getElementsByTagName and outerHTML (Internet Explorer, Opera and Safari - but not Firefox). It gets around the patent by dynamically "altering" the outerHTML (even though nothing is changed from the original HTML). But beware: you need to put it in an external JavaScript file to work.

To do this, simply put the code into a file. Let's say it's called eolas.js. Then put this line anywhere after all the object, embed or applet tags:

<script type="text/javascript" src="eolas.js"></script>

Alternatively, you can keep the script tags out of the body by wrapping the code in eolas.js in a function, then use my addDOMLoadEvent function to run the Eolas script once the page has loaded. So if you change eolas.js like so:

function fixEolas() {
    // same code above
}

then just put this in the <head> of the page:

<script type="text/javascript" src="eolas.js"></script>
<script type="text/javascript" src="adddomloadevent.js"></script>
<script type="text/javascript">
addDOMLoadEvent(fixEolas);
</script>

Unfortunately, the JavaScript file will be downloaded unnecessarily for users who don't use Internet Explorer or Opera. But if Safari or other browsers implement the same thing, this JavaScript code will already be in place to fix it.

And there you have it. Three cheers for horrible software patents!

Update: The code I posted before breaks objects with <param> tags in Internet Explorer. It turns out that outerHTML doesn't contain <param> tags, so extra work needs to be done to make sure they stay intact. I've updated the script accordingly.

Published on August 29th, 2006. © Jesse Skinner

Social Networking Spam

So everyone knows MySpace has gotten big. Really big. There are start-ups appearing every minute destined to become the next MySpace. This has attracted it a lot of attention.

Bands quickly realised the marketing power of MySpace. You can find MySpace pages for bands like Beck, Eminem, and of course millions of small bands.

If you have a MySpace page, you know that bands caught on to using MySpace as a way to do marketing thanks to the 'Add a friend' feature. They seem to constantly search on MySpace for potential fans, then ask those people to be their friends.

Now, the spammers have caught on. There are MySpace pages for the most mundane of commercial interests. How about this one which is just selling shoes, or this one which shallowly markets another web site. These aren't real people. Who wants to be friends with a shoe reseller?

I know this is just the beginning. Soon, MySpace spam will end up on every marketer's to-do list (along with "viral" movies on YouTube). And when that happens, when every MySpace member has to deny a handful of "friends" every day, then I think MySpace will fall. People are excited about the "MySpace generation", but I'm not sure they understand them. The more something is cool today, the more it will suck tomorrow. MySpace is about to become as uncool as the Backstreet Boys.

Published on August 28th, 2006. © Jesse Skinner

How to add gravatars to your web page or blog

Last night, I added gravatars to the comments on this site. The best blog post to see them is Blog Tipping.

Gravatars are globally recognized avatars. It's a clever way to let people upload a little picture that goes beside their comments. This way, people only have to add them once (at the Gravatar website) and they automatically work across all web sites implementing them. They use the MD5 hash of your email address as an id, so you only need to put in the same email address when you write comments, and your gravatar will come.

Implementation is very easy. You don't need to make any HTTP request on the server or anything. You only need to add an image that points at the gravatar URL, with some optional parameters, and the browsers of people visiting your site will download the images from gravatar.com.

The only required parameter is gravatar_id, the md5 hash of the email address. Every programming language has a way of finding an MD5 hash. PHP probably has the most simple example:

<img src="http://www.gravatar.com/avatar.php?gravatar_id="/>

There are also optional parameters you can use. rating lets you make sure there are no pornographic or mature images on your site. size lets you set the width/height to something other than 80px. default lets you set the URL of a default image, in case you want to display something for people without a gravatar (a 1x1 invisible image is the default). border is supposed to let you set the colour of a 1px border on the image, though I wasn't able to get this working. So the output of a complex example might look like this:

<img src="http://www.gravatar.com/avatar.php?size=50&border=000&gravatar_id=eb22390416c3b62025dc9ad2120a8ade"/>

It's worth noting that adding gravatars can be a css and design challenge. You don't know whether the image will be a real gravatar or just a 1x1 invisible image. If you add margins or padding to the gravatar, they will end up on the invisible pixel as well, and this can look weird. I solved it by indenting all comments 60px to allow space for a 50px image. If the image isn't there, the comment is just indented anyway. You can also solve this by setting a default image to a "No gravatar" image.

Gravatars can really be implemented anywhere you know an email address and may want to show an image. There is a Thunderbird add-on that lets you see Gravatars while you're reading emails.

For more details, or to see how to implement gravatars in other languages and blog publishing software, the Gravatar web site has a detailed implementation guide. If you just want to upload your own gravatar, go sign up.

Published on August 23rd, 2006. © Jesse Skinner

Connecting People

I've become convinced the ultimate benefit of the Internet is and will always be the ability to connect people. Lots of people know this already. You can see evidence of it by the rapid pace of new Social Networking web sites being made. But I'm not interested in these billions of MySpace rip-offs.

There have always been people-matching sites on the web. Dating and Friend-finding sites (connecting individuals to meet in real life) and sites for finding jobs (connecting employers with employees) are some of the most common examples. We can also see people connecting through the uses of forums, blogs, online groups and other communities. But I think there is a lot of potential for specialized sites that solve a very specific problem for a potentially large group of people.

Take a look at BookMooch. This is a new site which lets people trade used books. No money is exchanged. Instead you get points for mailing books to people, and you can use those points to get books mailed to you. It is a perfect example of the potential of connecting people. It's not just connecting me to you so that we can chat about our shared interests. It's about connecting anyone who wants to trade books, and allowing the most complex of trades to happen very easily. "I'll give this book to her, and she'll give that other book to him, then he'll give some book to you, and finally you give this book to me."

Web professionals should check out Programmer Meet Designer. It's a place for finding freelancing partners who can help out each other in any number of ways, from a few hours on a single project to a permanent professional partnership. Most notably, it's geared to a specific yet large problem of matching programmers and designers, and it solves the problem well.

The possibilities are rather endless, and I think the room for competition or co-existence between these sites are quite large. For example, there are a large number of job searching sites which co-exist in harmony. As I outlined earlier this week, there are job searching sites which specialize in jobs for web professionals. There are also dating sites which specialize in every conceivable niche. People can use more than one of these sites at a time, and many do.

If you're trying to come up with a new web business, try to find a way to connect people who can benefit from each other. These sites will always be in demand, simply because everybody benefits.

Published on August 22nd, 2006. © Jesse Skinner
<< older posts newer posts >> All posts