Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Hit Shift key 4x on a NYTimes article and see what happens (nytimes.com)
127 points by hammock on April 4, 2012 | hide | past | favorite | 60 comments


Fork it!

(oh, and tap Shift key 2 times, not 4)

Take a look at the Source on Github which has been updated from the original I wrote for the NYT. It also now uses jQuery (NYT was dependent on PrototypeJS)

https://github.com/NYTimes/Emphasis

Its a nifty project to contribute to and I welcome updates and discussion.


The pilcrow is too small. It's a small target, and I barely noticed them - I stood here tapping shift repeatedly until I quit and came to the comments to see what it was about... the grey background is also almost invisible.


That seems like a lot of code to, from a simple guess, shows/hides a hyperlink.


It enables paragraph based linking and paragraph (or sentence) based highlighting. With error correction in case the article has changed. Don't guess, read the release notes (http://open.blogs.nytimes.com/2011/01/11/emphasis-update-and... as noted many times in the comments here).


My ignorance, I skipped straight to the src after playing with the shift key. This is some damn cool stuff after reading the link.


You only need to press shift twice; the pilcrows that appear are paragraph-specific anchor links. They explain the system a bit at http://firstlook.blogs.nytimes.com/2010/11/30/a-few-new-feat...


A new word for the day: pilcrow. I never knew those ¶ thingies had a name other than "paragraph mark". Thanks.


You may also find its history interesting then: http://www.shadycharacters.co.uk/2011/02/the-pilcrow-part-1/


This was the most interesting comment here, more than the main post itself.


> You only need to press shift twice

Timing matters.



That's nice in how it allows you to link to individual paragraphs: http://www.nytimes.com/2012/04/04/health/doctor-panels-urge-...


You can also highlight sentences across all the text too


It looks like it's pulling characters from the paragraph to generate the "unique" paragraph ID. ID = First letter from the first 3 words in the first sentence in the paragraph + First letter from the first 3 words in the last sentence in the paragraph.

I wonder... for all the different articles on NYTimes, and the different configurations of words across paragraphs, is this unique enough such that you won't get duplicate paragraph IDs in any given article?


It only has to be unique within the article, since it's added to the article path, and there would likely be some kind of provision to add or swap out for a unique character in case of conflict. It's also case-preserving, so that implies likely case-sensitivity as well. I guess we'll have to find an instance of two - probably single-sentence - paragraphs with the same characters and same capitalization in the same story to be certain.

Not it!


Especially because it works in exactly the way you specify even when there’s only one sentence in a paragraph. So the paragraph:

That was too much for the water district’s attorney.

And:

They were torn apart by angry ducks.

Will both hash to “TwtTwt”. One-sentence paragraphs are probably deprecated in the NYT’s style guide anyway, but I imagine it might still come up.


One sentence paragraphs still happen but it still works :)


These are called WinerLinks, as in Dave Winer from over at scripting.com. The Times started doing this in 2010, here are his thoughts: http://scripting.com/stories/2010/11/29/theNyTimesLeadsAgain...

More info here: http://scripting.com/stories/2010/11/30/winerlinksAndOutline...

Note, that on his blog, he uses a simple, tiny # character after each paragraph to allow direct linking. No shift key required.


> tiny # character

... which is really annoying.

(edit) What I don't understand why he wouldn't show these # on hover over a respective paragraph.


Seriously. It's honestly one of the primary reasons I can't stand reading his stuff; each little hashmark is a reminder that the writer thinks his thoughts are so important you will want to quote them by chapter and verse, like a holy text.


Or an easy way to reference readers of your own material to any quotes you may use from him. This makes it a lot less time-consuming to link to his articles. Does this actually bring him more traffic? I don't know, but it's interesting to know that it's actually hurting his traffic from what you're saying.

Personally, I'd be more inclined to link to his article in my own because it's that much easier.


I believe the original name for them is Purple Numbers[1], though as Dave Winer mentions, the NYTs implementation doesn't appear to create the links properly.

[1] http://en.wikipedia.org/wiki/Purple_Numbers


No offense to Mr. Winer but if I thought for one moment people would call it this then I would never have been motivated to launch this code.


I tapped Shift 6 times and a nickel spit out of my USB drive. Amazing!


Whoever wired this up forgot that "p[MpaBtc]" needs to actually appear in the name of an anchor for the URL to reliably point to that paragraph. Clever idea but bad authoring that just fails without javascript.


Nothing happens in IE. Not that anyone here cares...


Nothing happens in Chrome 18 on Mac, either.

Works in Firefox 11, however. Also works in Safari 4 (an old version).


Chrome 18.0.1025.142 beta here and works for me.


Weird - works for me on Chrome 18.0.1025.142 (latest) on OS X Lion.


Nothing in Opera 11.62


Works for me (newly installed Opera 11.62 Build 1347 on Windows 7).


Which? I get nothing in IE10.


Shows up when you double-tap the shift key.


Will be interesting to know what the submitter makes from their affiliate link appearing in the submission.


I just noticed this when I tried invoke Instant Send[0] with a modifier tap[1] in LaunchBar. A bit annoying that it blocks the LaunchBar functionality.

[0]: http://www.obdev.at/resources/launchbar/help/InstantSend.htm... [1]: http://www.obdev.at/resources/launchbar/help/ModifierTaps.ht...


Copy text from this article, past it somewhere and see what happens:

http://www.newsobserver.com/2012/03/31/1969051/apple-plans-n...


The fact that people are only now discovering this year old feature goes to show how lacking its user interface is.

It's a great idea, and a great implementation, but it has no affordance whatsoever to promote discovery.


Ooh, I wish Readable would add this. I typically only use Readable for long articles. When reading part-way through, leaving, and coming back, it's a pain to locate the paragraph where you left off.


Sticky Keys?


It does seem a bizarre key choice, 5 hits of the shift key will prompt the sticky keys dialog to appear on most of the worlds computers that have a shift key.

Quite easy to do as a 'tic' when you notice this undiscoverable 'feature'.


I noticed the paragraphs after a couple clicks but was clicking too fast to stop when the change occurred. I got sticky keys too.


Wait, does the text shuffle around for anyone else when you click on a sentence?

EDIT: It looks like an odd CSS issue: the first line of each paragraph is being hidden.


I was so confused by this the other day... I didn't know why these paragraph marks were showing up all over the place.

Nice to finally find out what on earth that was!


Thanks for this. I've always known about emphasis.js, but not the keyboard shortcut.


Shows you the paragraph markup?


Nope - it allows you to link to individual Paragraphs as well as Highlighting sentences (just click them to toggle the Highlight).

As you do this it updates the URL so you can share it.

They Keys to identify the text are generated dynamically and tolerant to change (so if a Paragraph is modified or moved later on - rare) it will still link tot he correct one within a given tolerance.


Also allows you to look up the definition of a highlighted word.


Thats a separate script and not related to Emphasis


Nothing. Ubuntu 11.10 + Firefox 10.0.2.


ok... now that is pretty nice. I'll be adding that to my tool box. Thanks!


huh? why the down vote?


I didn't down vote. I guess someone thought your comment was content free. It is frustrating when you have low karma for people to down vote but not explain why. Usually they balance out.


I'm not even sure I know what "content free" means. So complimenting the post as being nice and stating that I plan to make use of the information in the future is worthy of a down vote? I wasn't expecting an up vote but I didn't think anyone would dislike my comment so much to take that 1 sec to click it down. Whatever.


It doesn't add anything.

Imagine your comment was at the top. The linked article doesn't say how to get the effect. Your comment doesn't say how to get the effect. So it would all be a bit mystifying.

Imagine your comment was in the middle of the page. There would be other comments below yours that would be more worthy of people's time to read than yours. So your comment should appear below those comments. Thus it should attract a few downvotes.

Upvoting the link would be more appropriate than posting a generic compliment.

If you had said "This is an excellent idea and I will steal it because (a) it will make it easier for people to link to and quote me (b) it will make it easier for me to link to my earlier articles (c) ..." then that would be different: you would be providing reasons, and that might provoke further useful discussion. It might not attract upvotes, but unless you were just repeating what someone else had said it shouldn't attract downvotes.

That one second to vote something down is not a serious barrier to downvoting. (Neither is the one second to vote something up a serious barrier to upvoting.)


Thank you for that. Now I understand sort of. I didn't think my comment was any less than a few others. But the way you put it makes me figure that several of the other comments that didn't add any thing were also voted down. But anyway... thanks for not just being a... oh wait... I've said too much already... I should just up vote your comment in silence. :)


awesome... 3 more down votes. At this rate I should be back down to 0 Karma by morning. If I am doing something wrong here wouldn't it be better to tell me what it is rather than just down vote in silence?


People interpret it as whining, and feel whining is deserving of downvotes.

It's not a community norm I agree with --- I feel that if you want to know what you've done wrong and you're not acting all entitled about it (oh, but some people might interpret your reactions as acting entitled) then someone should tell you.


I don't think my "why the down vote" was any type of "entitlement". It was a just a question. Could easily ahve been answered. and it was. but then it was also down voted.. which in itself is not helpful at all. The answer given was some what helpful but I had follow up to it. and that too was down voted.. still with no real helpful answer. So at that point I was more frustrated than anything. Now I understand.


You're kind of ranting about downvotes... no one cares, and it's annoying.

Why care about karma so much? It's just a mechanic this site uses, it's no reflection on your character.


I wasn't ranting at all. And certainly not the first time. I asked a simple question. Then a follow up question for clarity. And rather than help me to understand... people just kept down voting in silence. But now I know. Be brilliant or be silent. Got it. And I do care about Karma a little because that is the only way I will be able to go around down voting in silence like a coward. ;) j/k




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: