Updated Keyword Lookup Tool

I added a keyword lookup tool to PigPog ages ago. When writing, we just stick special tags around a word or words, and a bit of code behind the scenes turns the word into a special link. The page it links to is just a list of links to search for that word on various sites – PigPog, Google, Amazon US, Amazon UK, del.icio.us, Flickr, etc. It also includes a Chitika ad unit that’s been fed the magic word to have a stab at getting a relevant ad.

This was never the plan. I only ended up with this page because I couldn’t work out how to do what I actually wanted to do. I didn’t want people to have to click over to another page just so they could do the search, but I couldn’t work out how to do anything better. I knew JavaScript was the answer, but I didn’t know enough JavaScript to actually do it.

Well, I finally worked it out. The word highlighted in green is still a link to the old-style page, because the JavaScript won’t work in feed readers and such like, and it gives people another option if they just don’t like flashy JavaScript things. At the end of the word now, though, is a little double arrow. Clicking it should expand out a series of little icons, linking to all the different searches. The arrows reverse themselves, and you can click them again to close the icons.

Like this…

  • Nikon D40

If you click the little double arrow at the end of that line, you should see what I mean (on PigPog, anyway, it won’t work in RSS readers).

Also, the top part of the right hand column gets rewritten when you click one of these magic arrows, duplicating the search links, but hopefully a bit clearer for people who don’t know what the little icons mean (you might need to scroll back up a bit to see it).

Some of the links are purely there to be useful, and some are there because we make a bit of money if people follow the links and buy things.

Although all the code I’ve ended up with in there is my own, I should mention CodeHouse, because I’ve learned a lot from their examples. W3Schools is another great place to learn any web stuff – HTML, CSS, JavaScript, etc, and I also picked up my first bits of AJAX recently from Harry Maugans.