downloads, javascript comments edit

I love the Amazon Associate program. I’m a member and I even buy stuff from myself to get a kickback. It’s also a good place to send people when you want to show them books, music, movies, etc., that you’re talking about. Sort of like a database of “stuff.”

One of the beauties of the way Amazon set their stuff up is that everything is standardized - link formats, image naming, etc. Everything. Which means, of course, that people outside Amazon can interface with their stuff pretty easily. Good for them, good for us.

I integrated Associate links into my blogging program (pMachine) so I only have to enter the ASIN for an item and it builds the link for me. I wanted to take that one step further, though, so I present to you: Amazon Affiliate DHTML Image Tooltips!

The idea is this: Hover your cursor over any Amazon Associate link to a product and get a picture of the item right there in the tooltip. How sweet is that?

It doesn’t even require any change to your page structure, which is what I really dig. Just add a straight-up Amazon Associate link to your page like you usually do:

<a href="">A Cool Product</a>

Then add a reference to the script at the head of the page:

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

The script will automatically rewrite all of the Amazon Associate links in the page (that are in the correct format, as noted above) on the fly for you with the correct events and everything.

(It will also do text tooltips - it’s a modification to the Dynamic Drive “Cool Tooltip” script.)

It all ends up looking like this: Screenshot of Amazon Associate DHTML

The download includes:

  • dhtmltooltip.js - The actual script that performs the DHTML and link rewrites. Information on usage is included in the header of the script.
  • test.html - A test page illustrating the script usage (both Amazon Associate and text tooltips).

Note: Since the original release of this DHTML tooltip script, Amazon has released their own “link-enhancer” script that performs a similar functionality but in a more robust fashion, adding product description information and so forth to the tooltip. This DHTML tooltip script has been updated to work in conjunction with that, not modifying links that the Amazon script has already modified. As such, previous users of this script can easily add the use of the Amazon script to their site without worrying about clashing tooltips appearing. Amazon modified links appear correctly; those not modified by Amazon or explicitly using this DHTML tooltip script will continue to function as usual.

I’ve tested it in IE 6.0 and Firefox 1.0, which I think covers most of the people who show up to my site. I’m sure it’ll work with most any up-level browser, though if someone finds it doesn’t work on a particular browser, tell me how to fix it and I will.

Like it? Want it? Here you go!

Download Amazon Associate DHTML Image Tooltips Script 2.1 (.zip file)

Version History: 2.1: Added support to allow co-existing with Amazon “link-enhancer” script. The DHTMLToolTip will not be added to links that have been “enhanced” by the Amazon script. 2.0: Converted to “object oriented” JavaScript to avoid name clashes. Fixed minor bug with positioning in newer browsers. Safely attaching to all events (thanks to Phil Haack for this). Updated so script is placed in HEAD of document. 1.0: First release.

General Ramblings comments edit

It seems that Fred Meyer has finally started carrying Senseo coffee pods (which, apparently, are coffee pads in other countries, but the US somehow got different terminology), which I am happy about. Now I won’t have to make my own, which looks like a tough prospect at best, nor will I have to drive to hell and back to stock up.

General Ramblings comments edit

It’s nearing election time again, and the amount of spam coming in to me with political messages is increasing noticeably as election day nears, so I figured it’s time once again to offer up a public service announcement to all the souls out there who feel the need to send me messages on various topics:

Always check your facts.

I think this is a good rule of thumb for anyone sending anyone else a message on basically any topic, but it’s particularly important when trying to communicate concern to others regarding political issues - nothing is worse than misinformation.

The best place to start, especially if the message you’re passing along is a letter you received from someone else in a chain-letter format, is Snopes, the Urban Legends Reference Site. This site dedicates itself to debunking urban legends of all forms, including the chain letters that make their way around the Internet. More than likely the letter you’re sending out is already on Snopes and has been checked out. The beauty of Snopes is that they list the various letters, tell you whether they’re true, then point you to official reference sites so you can check the facts yourself.

If it turns out that the email you want to send is actually true and it’s something you feel I should be concerned about, send away. (That said, you might want to take a couple of seconds to clean up the 100+ lines of forwarding headers on the mail so I don’t have to scroll down, down, down, down to get to the four-line message itself.)

Thanks for your effort, I really do appreciate it. See you at the polls!

General Ramblings comments edit

Friday night I busted home and went to dinner at a Chinese place with Jenn and some of her coworkers. I generally like her friends, but I don’t really know them, so it’s hard to get too excited about going out with them.

We went to a place that serves Chinese “family style” - everyone at the table orders one big plate of something, sticks it on the lazy susan in the middle of the table, and shares.

In the immortal words of Joey Tribiani, “Joey doesn’t share food.

I hate family style Chinese - almost as much as I hate Szechuan (I’m a Cantonese fan - more deep fried is better) - so I wasn’t too pleased to discover this, but it all ended up all right. I had some lemon chicken and Jenn had sweet and sour chicken, and we got an order of fried prawns ($1 each! expensive!) and some pork fried rice.

Saturday was the day to have your birthday party, or at least it was according to the people I know.

Saturday afternoon the extended family gathered in Sandy, OR for my grandfather’s 80th birthday. People I’d only ever seen like twice in my life were there (and they all expected me to remember their names and relation to me since the last time I’d seen them, 24 years ago or whatever). It was fun to see everyone, but it slowly turned into a school dance situation where each of the “families” (or “cliques”) would gather in a given location and talk amongst themselves rather than mingle. Which was OK by me, since I get along just fine with my parents.

After that, I went home for a quick nap in preparation for the next party, which started about 7:00p.

The next one was for my friend Jason, who I’ve known since college and who always has a great party. This was no exception, though I’m sorry to say that, due to both Jenn and I being a little tired (and some substantial intoxication on the part of yours truly) we had to leave a little earlier than originally planned on.

Two and a half hours in the bathroom at home and I was doing much better. (Let it be known that this is the only time I’ve ever puked from alcohol - this is not a regular occurrence. And it really, really sucked, so I don’t plan on doing that again any time soon.)

That said, the party, as always, was a great time and I look forward to their Halloween party.

Sunday I had planned on getting together with an old friend who I’ve been trying to get ahold of since before last Christmas. I like the guy

  • we were like brothers in high school - but over time our schedules have become conflicted and we just don’t see each other much anymore. I’ll shoot an email or a phone call his way every so often to see if he’s freed up any (his time seems to be much more constrained than my own) and if I get a reply, it’s usually that he’s still busy.

Anyway, I got ahold of him via instant messenger on Friday before coming home and he said he’d call me Sunday morning so we could get together, he could see my house, and we could catch up. He even went so far as having me email my phone number to him so he wouldn’t forget to call me.

He never called.

So now I’m feeling like the jilted, abused lover in a bad relationship and I’ve come to the conclusion that I’m tired of being the only one to put out any effort in getting together. You know what? Fuck it. If he wants to get together, he can make the effort now. I’m not gonna take this shit anymore.

Sunday we ended up doing errands and such, which did need to be done. Ugh.

And that’s the weekend in a nutshell.

windows, dotnet comments edit

I stayed late after work last night to try and get some help with my SendTo menu project. Talked to a guy smarter than me at C++ and, while he gave me some ideas as to what I should test, the problem still isn’t solved, so I still can’t tack the SendTo menu into the Visual Studio .NET solution explorer.

Interfacing with the Windows shell shouldn’t be this hard. I mean, I’m a smart guy. I’m no Raymond Chen, but I’m a smart guy nonetheless. I just don’t think it should be this difficult. In a day and age where the rough stuff is abstracted away by managed code and garbage collection, someone much smarter than me should have already figured this out and fixed it by now.

I guess I’ll keep trying. Seriously, though, if anyone knows of someone who understands shell programming in C++ (and, hopefully, also knows managed extensions for C++) and would like to fix this thing for a little piece of fame (no fortune, sorry… maybe a six-pack of your favorite beverage?), let me know. You’ll be helping the world as we know it.