Awesome, they just invented a small part of Ted Nelson's Xanadu project. Say what you will about Xanadu being vapour-ware but at least Mr Nelson designed it properly to handle problems like deep-linking and track-backs which the Web has to employ workarounds for.
Speaking of NYTimes, Safari user stylesheet has a line to disable the annoying word definition popup when selecting text.<p>.nytd_selection_button { display:none; }
On Github, they say they'll eventually remove the dependency on PrototypeJS. The library is only ~10k now, hopefully that change won't increase the size too much.
Grats donohoe, well done. What is of particular interest to me here is the use of the Levenshtein distance algorithm. The reason this works well here is because you are comparing your supplied key against a constrained set. Applying the Levenshtein distance algorithm (or its variants) against a constrained set of small size in this fashion has virtually no performance impact as the time to complete is entirely based on the size of the set you are matching against. On the other hand, matching against a set of millions of records does get costly.
I think v2 is trying to solve a problem it shouldn't have to solve. If the NYT made available previous (published!) revisions of their content, there would be no need to assign paragraphs with special IDs or the like. You'd simply say, "get me p2 for the story as it was on Jan 11 15:33". When you link to a specific piece of content, it's in the hopes that people will read or see the same thing you saw when you made the link. You don't want to be talking about different things, so revision-awareness would actually make more sense overall.
I played around with this and got it so you can both highlight and have it move the view to the paragraph of choice. Seems pretty interesting.<p>An issue with it though, when sending the link to someone, and then they click it, browsers (Chrome here) turn the #h[TArTWw,1] into #h%5BTArTWw,1%5D which then seems to be ignored by the script.
I made something similar to this NYTimes.com feature, a few days ago: <a href="https://github.com/alexbarredo/insidelink" rel="nofollow">https://github.com/alexbarredo/insidelink</a><p>It's simpler, of course. It's in plain JS and as jQuery plugin
I don't understand what's so awesome about this? Browsers have supported deep linking since forever. You can link to any specific id on a page and the browser will scroll to it when you open the page.<p>For example, I could have every paragraph an id say id="p5" and then link ad example.com/story#p5 and voila, deep linking.<p>Hoorah for reinventing the wheel :)