3 ms·
Hrm, in the HN source v3.1, there's a function canonical-url that strips off anything after a ? in the url, but only when the site is in stemmable-sites* . If u
by zck 17y ago
Hrm, in the HN source v3.1, there's a function canonical-url that strips off anything after a ? in the url, but only when the site is in stemmable-sites* . If used to find dupes, this would work. However, there are only two places in the entire source (reported by grep) that refer to the variable stemmable-sites* . The first is in the definition of canonical-url. The second is assigning a table to stemmable-sites* . As far as I can tell, no urls are ever added to the table by the code, only by hand.
It seems like stemmable-sites* is used to tell what sites don't use the query sting (the part of the url after the question mark) to differentiate pages (see: on Wikipedia the url http://en.wikipedia.org/w/index.php?title=Elvis http://en.wikipedia.org/w/index.php?title=Elvis differs from http://en.wikipedia.org/w/index.php?title=Elvis_Costello http://en.wikipedia.org/w/index.php?title=Elvis_Costello only in the query string, but the two pages are different), so they can be safely removed, and still get the same page.
The problem here is that google's adding query strings to other site's domains. Now, these query strings don't change the page. However, HN assumes by default that they do, so it doesn't remove them in the canonical url. Since google is adding them to every link, you can't add a set of urls to stemmable-sites* and let canonical-url strip off the query string. It seems like you could remove any arguments with field names utm_source, utm_medium, or utm_campaign, but that would assume that no site uses the field/variable pairs to differentiate pages.