Live data from Hacker News

Show HN: Days Since Last Elon

dayssincelastelon.com

1–10 of 13 posts

Re: Show HN: Days Since Last Elon

#3
post #2

Stack was hugged to death... anyone has a screenshot or description?

Calendars for a number of news sites and aggregators, showing, per their methodology, of when "elon" appeared on their front page. I have to say that a couple of their results seem suspect to me so I question the methodology

Re: Show HN: Days Since Last Elon

#7
This is funny. I'm curious how exactly you count an "elon". E.g. Google news shows no Elons, but that is for sure 100% wrong.

Also maybe you shouldn't be counting news aggregators like Google News? Its basically double counting since its already on some other site.

Re: Show HN: Days Since Last Elon

#8
post #3
post #2

Stack was hugged to death... anyone has a screenshot or description?

Calendars for a number of news sites and aggregators, showing, per their methodology, of when "elon" appeared on their front page. I have to say that a couple of their results seem suspect to me so I question the methodology

OP here. Happy to share any details as I deal with the hug-of-death...

What seemed off to you?

Re: Show HN: Days Since Last Elon

#9
post #7

This is funny. I'm curious how exactly you count an "elon". E.g. Google news shows no Elons, but that is for sure 100% wrong. Also maybe you shouldn't be counting news aggregators like Google News? Its basically double counting since its already on some other site.

I _had_ no good answer for the Google News result until you prompted me to Inspect source just now...

I'm basically scanning for tags and searching the text within. Doing a Google News inspect, it appears that their links actually have no text, but are sibling elements of an tag. So, I need to figure out how to parse that correctly...

Re: Show HN: Days Since Last Elon

#10
post #9
post #7

This is funny. I'm curious how exactly you count an "elon". E.g. Google news shows no Elons, but that is for sure 100% wrong. Also maybe you shouldn't be counting news aggregators like Google News? Its basically double counting since its already on some other site.

I _had_ no good answer for the Google News result until you prompted me to Inspect source just now... I'm basically scanning for tags and searching the text within. Doing a Google News inspect, it appears that their links actually have no text, but are sibling elements of an tag. So, I need to figure out how to parse that correctly...

> Doing a Google News inspect, it appears that their links actually have no text, but are sibling elements of an tag. So, I need to figure out how to parse that correctly...

I just checked Google News myself, and you are correct that the sibling tag has the text. However, the tag with the link has it too, but as a prop instead of being nested inside. Unless I am mistaken about the use case of that prop here, you can just extract the text from the aria-label property of the tag.

And in case you want to proceed with parsing text from the sibling tag instead, you can just get the list of the parent tag children nodes (yourAnchorTagNode.parentNode.parentNode.children; had to do a double .parentNode, because the tag is wrapped in a singular tag) and then search for the only tag there. That will be your target tag with the text.

Post reply on HN