Thursday, November 15, 2007

Blocking AdBlock

I've been asked for suggestions for how one might go about blocking the AdBlock add-on/plug-in from working in Firefox.

My first reaction, (as an advocate of the people... oh boy, representin' for the peeps, just what theys need, another techno insomniac confusing social networking with the actual concept behind the word "social"), er, as I was saying, my first reaction is "POWER TO THE PEOPLE!". Let's face it, if ads weren't so damned offensive, and more importantly, intrusive, slow, uninspiring, sleazy, annoying, etc, etc, this wouldn't even be an issue. So all you marketing/ad-tech sphincters out there, shame on you for putting us all in this predicament in the first place! This is what happens when "the market" rises against you and adopts a variant on the spank-a-logical protocol! (Oh and P.S., You suck!)

OK, then after popping a Valium and digging into my vast knowledge of front end web development techniques (wow, the annoying sarcasm runs deep in this one--who wounded you so, oh jaded chum....p) it seems to me that perhaps a campaign of punishment might be poised to elicit the most effective response.

Here goes:

0. (Look Ma I'm zero indexing!) Create a script in a directory under the host you are serving your page from. This can be a client-side script, such as JavaScript (um, that's me giving subtle props to you poor schleps that think MS proprietary (or hell, ANY proprietary) "alternatives" qualify as client-side scripting at all... doh, did I just type that out loud).

Said script will need to set a session cookie, from the host your content lives on (so as to avoid cross-domain security issues). It should probably return nothing visible, just set the cookie and be done with it. It's most likely this puppy is gonna need to get called into a remote iframe not intended to be viewed by the ...er, viewing public.

1. Assuming your ad server is centralized on a "remote" domain and done so in order to facilitate ad serving across multiple domains, blogs, etc., you'll need to incorporate a means of obtaining the caller's domain. This can be done by adding a parameter to the query string requesting the ad from your source, or it could be trapped for in the referrer, (or "REFERER" for the sp3lling challenged amongst us, I call them sysadmins, but that generally gets me mysterious punitive restricted access in shells and/or loss of sudo rights, so I inevitably retract).

Note: If you pass the referring domain via query string parameter, you'll need to parse on the other end, so if you can use the built in referrer constructs in JavaScript that's a nice simplification.

2. When you create a new ad placement in your ad server, include a line of JavaScript to callback to the cookie setter script described above. Note: It's important that the cookie get set on the domain the ads are getting called from.

3. You need an additional line of script in your calling page to "evaluate" the cookie AFTER the ads have loaded. This can be a little tricky. I believe you can actually trap for the onload event, but if you belong to the "AJAX" generation... wow, what a load of crap, back in my day... er, nevermind... trapping for onload most likely won't work for you AJAX folks (or your forebears that use other methodologies for asynchronously including content).

For example, if you are calling your ads in via iframes particularly in a post-load scenario--which all "good", well "grey good" since it's still not really "good", banner serve scenarios do in order to allow the UI to be rendered and operable to the user prior to making the calls to your slugly (slow + ugly) remote ad server which ...holy cow... can take f-o-r-e-v-e-r to come back, which they eventually do, mostly. (Yip, sometimes they never come back... oh I said it!) Anyway, taking this approach can greatly improve UX and if you can't abandon ads as a monetization scheme all together, I highly recommend going a post load route.

As I was saying, in certain cases when using iframes, ajax, or even post-load + DHTML techniques to bring in ads, the onload event will fire before the remote ad is called in... meaning you can't use onload by itself to trigger a check for the existence of the cookie.

I suspect the most "reliable" (and I use the term as one does for virtually anything remotely complicated in the realm of web development) approach to ascertaining whether the "good to go" cookie has been set by the remote script is to assume a time to live of 5-10 seconds after onload (you'll see why evil marketing people everywhere love this technique in a minute). Check each second while the TTL is in effect to see if the cookie has been set. If it has, cancel the TTL and life is good... this means your ads were called in and your callback mechanism functioned to confirm it1.

4. However, if after the TTL expires the cookie isn't set, then... (here's the evil part) bounce the location.href to http://adblockplus.org/.

The reasoning goes as follows: The visitor has obtained a plug-in from these folks that is designed to alter the experience of the user. By tantalizing a reader who is using this plug-in with a brief exposure to the content they were presumably after you create an angry customer. However, the customer doesn't get angry until he or she is viewing the adblock page pitching the virtue of using the plug-in. Yes, it's true, it's bad user experience... and I am, and always intend to be, a user advocate. It just seems to me in this scenario the user has changed the rules by being tricked into colluding with their new "preferred" partner--the adblock folks. It seems only fitting then to let the adblock folks themselves remind the user why they are unable to access the information they were after.

If this is too Machiavellian then perhaps you're on the wrong Internet. (Coming soon to an Internet near you, IPv6 and goodness for all. Super-man will be signing autographs in the foyer, ...for $25 bucks a pop.) Or, perhaps you can choose to do something else with folks failing the cookie check.

For the rest, peace out.


P.S. I'd very much like to entertain your suggestions for simplifying this, or what about it doesn't work, so on so forth. Yes, yes, what if they don't have cookies, or their browser doesn't support them. What if they're using lynx or God forbid, wget... perhaps worse still Safari (woah, I'm just kidding!). Anyway, I'd love your input.



Notes:


1. Well, so there's an additional caveat here. Since much of the ad code that gets cut/pasted into ad servers actually creates a call to yet another remote domain it's still possible that--that domain may be blocked. So, your check served to validate one step of the complicated journey home, but may not speak to the next leg which exists outside of it's scope. This could be overcome by a similar check between these end points, however at this point you are reliant on folks at CJ, LinkShare, or any number of other venues... and at least in my experience, they don't tend to be able to help at this level. Perhaps I just don't know the correct folks.

Sunday, November 11, 2007

Alternative Transportation

Ivan needs sleep. But since that's not gonna happen, let's crack open his head, pour out some of the dream matter, and play in the goo--it's for fun1.

Stuck in traffic on the way to work the other day I lapsed into fantasy. Not the kind where beautiful women instinctively flock to me like the salmon of Capistrano2... ewe. (Sorry honey, I love you... uh, you, complete me3.) No, rather the kind where you fantasize about beaming into work, or better still the local Starbucks. Though a nerd I am, even I don't linger in the fantasy of matter and energy being interchangeable for purposes of saving money on a scene involving the ground, a spaceship, actors, and witty dialog to sew it all together. "Never surrender, ...to infinity!"4 Ugh, this incorrect reference thing is getting out of hand, how now to put down Frankenstein's monster? On an up note, computers will never be able to take over the world5 as long as incorrect references permeate human discourse, they are just too damn confusing! But I digress from my digress...ion.

So, stuck in traffic, not fantasizing about women, not fantasizing about a Star Trek style transporter, I was fantasizing about alternatives to my car, and more importantly to being stuck in a metal clad sea of humanity probably entertaining final solutions of their own... sorry, that's a terrible reference.

For a moment I was considering flying alternatives. Since I disdain anyone that can fuel a private jet--and actually does, a plane is out. Besides, as a minion serving capitalist dogs, I don't have property holdings with sufficient expanse to accommodate the technologies available to those bloodsuckers anyway, perhaps the term "runway" is more familiar to those less-jaded amongst us.

That could leave vertical take-off as an option. However, the energy expenditure required for vertical take-off craft of today is wholly unacceptable in my mind. Besides, all the governmental beauracracy I'd have to endur, and more importantly pay, and perhaps pay under the table as well completely defeats my objective to "do good". What kind of hypocrit dreams of the destruction of poor efficiancy systems when they are subsidizing one?, I'd have to be some kind of er, hypocrit.

That might still leave lighter than air vertical take-off. I realize however that I don't understand the calculations necessary to create a container for such an effort. Further, ascend and descend functions would probably require the onboard creation of lighter than air, um, stuff. And the expulsion of said stuff into the ecosystem, which may have unacceptable repurcussions as well.

Further, since the atmosphere is unpredictable (at least to the mind of a computer programmer stuck in traffic not fantasizing about women) there remain the problems of generating and controlling lateral movement, not getting blown off-course to Siberia by the prevailing winds, not getting crashed into by other air traffic, not banging into powerlines or mini tributes to the tower of babel, and of course not getting struck by lightning or pooped on by birds or meteors. An overwhelming array of villians to be sure.

This is the point at which I began considering a story circulated through the ranks of those of a certain "christian" persuasion that raised me ...after the wolves gave up. Since I'm a devout skeptic, I hardly offer these as scientific principa-do-hickees, but as long as I've mentioned the Star Trek transporter system I figure fantasy isn't off the table (ouch that's gonna hurt in the morning).

I've heard it expressed that *gulp* angels, or whatever you want to call "them"--aliens, figments of an over active imagination, or a desperate need for life beyond the cruel finality of death; or simply what I'll call them, a hypothetical variable named "N".

As I was saying, I've heard it expressed that "N" travels on a beam of light. Oy vey. Yet, the idea is interesting. As a student of well something--science, science fiction, Harvard, monkey island, whatever ...it seems that there is a serious problem we humans have to overcome. If we're going to branch out into the universe (ugh, as long as I'm going off the deep end I might as well pick up a loaf of bread on my way down) we need to be able to move faster. Or perhaps smarter--if you buy into the worm hole idea7.

Since there's no basis in fact for how one might do this, it's basically as easily dismissed as the matter-to-energy transporter, but let's face it... we need some movement along one of these lines if we're ever going to achieve the break-through that must come if we're going to solve this problem. And if getting me to the office with a savings of fifteen minutes is a side effect then sign me up!

At this point, I managed to sneak out onto the off ramp. Left with the idea that creating a dirigible is probably just a problematic as the airplane scenario.

It seems a desirable solution would have these properties:

1. No or at least low reliance on existing infrastructures--particularly roads. And, I'll throw in petroleum here as well.

2. Feasible given current technology. This however may be a critical flaw... too often I think we allow the internal pragmatist to guide us in to compromise to accommodate not pushing ourselves to invent new--radically divergent innovations. (Perhaps I've just developed an allergy to my own medicine--at work I favor leveraging existing code, extending existing/mature process and technology, and routinely prescribe ringing out additional droplets from current products and marketing offers. But hey, this is about not sleeping and fantasizing about alternative transportation methodologies, so screw guilt!)

3. Less expensive.

4. Convenient.

5. Sustainable.

6. Non-destructive. (I guess that means the internal combustion engine might be off the table.)


And now that I've basically gone nowhere... until my next insomniatic episode, (or acid trip), peace out.




And the references...

1. "It's for fun" -Strong Bad, Home star runner

2. Dumb and Dumber

3. Jerry McGuire

4. An amalgamation. A concept from Star Trek--and the real-world reason for it's "invention" (saving money on what would have been a campy Flash Gordon-like scene involving wires or perhaps poor matte work assuming that was even available at the time). Star Wars--Episode III (the disdain toward poor dialog--among other factors--ruining what might otherwise have been the Tristan and Isolde of science fiction). A nod to Galaxy Quest for it's brilliant turning-inside-out of the behind-the-scenes of Star Trek. And, Toy Story... I've been in a Tim Allen kick recently, he's delightful6.

5. A convoluted reference to the idea behind the Matrix, as I understand it.

6. (Doh, a reference in a reference.) "He's delightful" is a reference Bart Simpson makes to Billy Crystal regarding his hosting of the Emmy's or some meaningless awards show where a bunch of monkeys pretend they belong to our species.

7. Uh, the worm hole idea as I understand it is: Instead of going faster, you go shorter... Dune's concept of interplanetary travel is my favorite example currently which is basically that you consider point A, and point B--and then you make the space between them go to zero. Voila, "there you are"8.

8. (Another reference in a reference.) A shortening of the quote "Just remember, where ever you go, there you are." attributed to Buckaroo Banzai.

Friday, November 09, 2007

Pidgin Sucks!

Wow, I feel like a jerk for saying this, but Pidgin sucks! I wasn't hesitant at first when trying to update GAIM to find that Pidgin was it's "wave of the future", but a day later--I'm uninstalling the damn thing and switching to a different client... after years of loyalty!

The reason?, when you hit a key like backspace or the up or down arrow while chatting, the speaker (which isn't a part of the volume controls your OS operates) gets chirped. Not a warm fuzzy chirp like a chic makes, but a frigging honk from hell, loud enough to make you actually sh#t your pants. Not once mind you, but every time your spastic fingers hit "the wrong" key.

I hunted for a solution and found suggestions ranging from "it's not our fault", to reprogram your registry, to switch to a different operating system. Come on folks, I know you disdain social functionality in all their tedious forms but on behalf of the human race, "pull your collective heads out".

So, while I would normal applaud the volunteer programming community that gives us so much awesome stuff, on this day I can only remark, "go to hell a-holes"! I'm going down the road.