Show HN: Add a “1” to your Hacker News URL to get fancy social previews
For example, paste this into Slack or Discord or whatever: https://news.ycombinator1.com/item?id=30179549
It works with comments, too: https://news.ycombinator1.com/item?id=30180253
Hastily-developed source: https://github.com/statico/ycombinator1.com
74 comments
[ 3.0 ms ] story [ 124 ms ] threadI personally wouldn't register someone else's domain with a 1 on the end, just because of fear of trademark law, but I guess it worked out this time.
https://i.imgur.com/YAEEesv.png
That being said, it's probably not much of an attack surface given the transient nature of the links.
(Will I run out of free Vercel function execution credits or whatever? Probably. We'll see, I guess.)
EDIT: Vercel gives me a realtime function log but it's pretty basic and has no statistics: https://cln.sh/WlXBSY
It looks like this only adds social graph info but is otherwise a redirect. The resulting page looks like
I feel like any reputable agent calling for open graph stuff is going to be labeled correctly, though I'm open to being wrong.
But if the scraper is using Puppeteer, either approach will result in the redirect being followed and the Open Graph data being ignored.
For example, Microlink follows the JS redirect and seems to ignore your Open Graph data: https://microlink.io/meta?url=https%3A%2F%2Fnews.ycombinator... Scraped data at this time: https://i.imgur.com/pRLIt0S.png
This is normally the behavior you want from a scraper: if someone pastes a bit.ly / t.co link you want the link preview to show data on the other side of the redirect.
You could try to figure out how to distinguish between a scraper and a human operator, but that'll be tough, since people work very hard to make Puppeteer look 100% legit.
This is what it looks like in Discord:
https://i.judge.sh/XWc64/D_jqGLfScD.png
At the time it was read from the server, which in most cases is when the sender hit send.
I like the idea and would use it. But the readme doesn’t give me that context, only the additional comments made here.