Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

When you follow a permalink to a chat message in the Stack Exchange chat, you get a view of the transcript page for the day that contains the particular message. This message is highlighted in yellow, and the page is scrolled to its position.

Sometimes – admittedly rarely, but it happens – a web search will result in such a transcript link. Here's a (constructed, obviously) example: A Google search for

strange behavior of the \bibliography command site:chat.stackexchange.com

gives me a link to this chat message. This message is obiously unrelated to my query, but the transcript page does indeed contain my search terms – just in a totally different spot.

Both the above links lead to the same content, and Google knows this, since both pages have

<link rel="canonical" href="/transcript/41/2012/4/9/0-24" />

in their <head>. The only difference between the two links is Which message has the highlight css class?.

Is there a way to let Google know that while all three links have the same content, they put an emphasis on a different part of the content?

Note that the permalinks on the transcript page already have a #12345 hash to "point" to the relavant chat message, but Google appears to drop it.

share|improve this question
    
Curiously, I'm getting "No results found for strange behavior of the \bibliography command site:chat.stackexchange.com." when I click your link. Instead, Google gives me the results for the same query without the backslash, of which there are four, none of them from April 9. –  Ilmari Karonen Apr 13 '12 at 3:22
    
In fact, the only result I get when I search directly for "TeX, LaTeX and Friends - 2012-04-09" site:chat.stackexchange.com is this page. –  Ilmari Karonen Apr 13 '12 at 3:25

1 Answer 1

Given the incredible popularity of Google (it is 90% of incoming traffic on Stack Overflow, for example), couldn't you simply check the referer?

Example referer strings from search engines:

www.bing.com/search?q=javascript+date+to+timestamp&src=IE-SearchBox&FORM=IE8SRC

www.google.de/search?q=apache+restart&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:de:official&client=firefox-a

us.yhs.search.yahoo.com/avg/search?fr=yhs-avg-chrome&type=yahoo_avg_hs2-tb-web_chrome_us&p=concatenation+in+mysql

I know Google is switching to a lot of SSL, so that might affect whether or not you get the referer, but if you do, you can definitely jump to the matching section in the chat transcript based on the search query string passed in there.

share|improve this answer
    
This creates memories of bad "Hello Googler, I see you're searching for X" sites -- but yes, it's an nice workaround. Of course, I'd also love that Google knows the relevant part of the page, but the idea is certainly interesting. –  balpha Apr 12 '12 at 6:40
2  
you could also perhaps detect the inverse, when it is highlighting the wrong passage, that has zero of the search words -- and decide not to highlight anything? Better to try to match what they searched, but that may be hard if it's a partial match and not a perfect "this is a quoted string" result, which is kind of artificial. –  Jeff Atwood Apr 12 '12 at 6:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.