February 27, 2011

Salon sends all of your clicks to Chartbeat

I'm an idle clicker. I'm always making sure the windows I'm looking at is the frontmost one, or just clicking to the side because something else stole focus and now the page won't scroll with my mousewheel.

Today while reading Salon I noticed that a little hourglass (or spinner, etc.) would show up when I clicked on any whitespace on the page. Given that popunder ads are at epidemic proportions these days, I wonder if this is related, a bug in AdBlock, or what. I bust out Wireshark and lo and behold, I see the following:

GET /ping?h=salon.com&p=[page being clicked on]&u=vanlgrt044uytfp6&d=salon.com&g=1614&n=0&c=4.75&x=3200&y=6963&w=855&j=30&R=1&W=0&I=0&t=f5gb7u5f6c7246dy&_ HTTP/1.1
Host: ping.chartbeat.net
Connection: keep-alive
Referer: [page being clicked on]
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

This bugs me. I know why they're doing it, but believe me, Salon is not shy about implementing user-hostile advertising and I have been annoyed of late by their persistent modal (page-blocking) ads. Reasonable minds differ, but I have decided that Salon is persona-non-grata when it comes to their advertising ethics. They're being lazy, they could do better, and I will feed them as little usable data as I can control beyond a basic pageread from now on.

Salon puts the codepull in after their Google Analytics junk:

var _sf_startpt=(new Date()).getTime();
var _sf_async_config={uid:1614,domain:document.location.host};
window._sf_endpt=(new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src',
(("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") +
"js/chartbeat.js");
document.head.appendChild(e);
This means that you can get by with by putting the following in your hosts file:
127.0.0.1 static.chartbeat.com chartbeat.download.akamai.com
That's
/etc/hosts
on OSX and unixlikes, and on Windows (typically)
c:\windows\system32\drivers\etc\hosts
Unfortunately, hosts files appear to be the only way of dealing with this currently. They hide the codepull for this feature in the HEAD tag like you would with Google Analytic code, so you have to use your hosts file due to code included on a page this way not showing up in AdBlock's "open blockable items..." feature.

November 16, 2009

thought for the day

Ever notice how many Rails developer blogs use Wordpress?

November 10, 2009

Rails Sortable Draggable params

Went around in circles a bit today implementing a barely-fancy list-to-list drag 'n sort. I don't do much Ajax usually, so I tend to lose my place, forget little things, and basically keep my Googling skills in tip-top shape to make up for my shoddy memory.

Anyway, enough backstory. You gotta use a word when id'ing your elements in sortable_element. It doesn't even matter what you use:

<li id="adfasjkd_<%= partialname.id %>">

(or however you're generating unique IDs for your LIs)

...as long as you have <ul id="flarfydarf">, Rails seems to be smart enough to chop whatever is not unique in the LI ID and throw it into params[:flarfydarf].

There are plenty of older tutorials out there with regexes in js functions inside the Ajax business, but I don't have any of that and Rails is finding my IDs just fine. Go figure.

May 26, 2009

Classics in autodidacticism

Is this supposed to be usable? Just sayin'.

March 21, 2009

Doing it right, part 1

Just so I don't just come off as a cantankerous fool, I'm posting about AuthLogic, an authentication plugin for Rails. I haven't used it yet, but looking at their github page it seems apparent that they value decent documentation. Much better than the two-line READMEs that too many projects throw up there.

March 11, 2009

Where I start to wonder

Someone should write a guide on rehoming webpages.

March 6, 2009

Rails Forum annoyance

Check it out.

You want to read some Rails goodness at the awesome Rails Forum so you're gonna log in, right? You type in your email address or username, finishing the first of three steps. You aren't my mom, or your grandfather, or any of the other myriad computer users and/or internet logger-inners, so what you don't do after this is reach over for the mouse and click on the password field. We've seen those people, and it's fine for them, but we are power users and possibly even touch-typists. We want to read, we want to help, and we want to get past the login. Without the mouse. So after typing our email address, we hit the Tab key to hop on over to the password field so we can authenticate and be on our way.

Well, maybe.