News for hackers. Stuff that matters.
Re:The CDC waited 'it's entire existence for this moment.' W... by tzs on Wednesday June 03, 2020 @04:43PM (#23408452)
What should count as "the headline" for a link? The contents of the <title> element in the <head>? The contents of the first <h1> in the <body>? I asked this once [1].

Part of dang's response:

> What the rule means by "original title" can be any one of the candidate titles that an article itself provides. That can be the main heading on the page, but often that is misleading or baity, especially with media sites. The HTML doc title, as you point out, is often a good alternative. Often a subtitle is better than the main title. Other good places to look are the URL, photo captions, and the opening paragraph.

After you figure out which of those should be "the headline", then you've got to deal with the possibility that it is too long. Try to shorten it? Try one of the alternative sources dang lists?

It also might not be plain text. The .innerText of the element you choose will usually be what you want, but I'm not sure that always will be right.

What might be reasonable would be to for the HN submission page to extract several candidate titles from the page and ask the submitter to choose one one of them, with an option to enter a headline manually if the submitter doesn't think any of those work as is.

[1] https://news.ycombinator.com/item?id=22931845

Re:The CDC waited 'it's entire existence for this moment.' W... by raverbashing on Wednesday June 03, 2020 @04:47PM (#23408507)
The title tag for this article seems correct, so that's probably the 1st choice. The <h1> is similar but the title has "- The New York Times" added to it.

I believe the clickbait issue might be valid for less reputable sites, but in this case it works.