Live data from Hacker News

Show HN: This website is valid JSON

webdatarender.com

21–30 of 240 posts

Re: Show HN: This website is valid JSON

#21
post #16

This is an interesting technical hack, but I have to ask what problem this is aiming to address?

I created this tool with a very odd necessity: I hate animations and overlay ;). I would like to have access to the website data directly and build my own interface, but for this, I would have to have access to the information only. I know that the website could expose an API, but WDR feels much more natural and easy (try to do a `fetch` on the page and get the JSON instantly).

Now that I have built and have played around a bit, I don't see how can I build a website in any other way.

For me, the website's information is important, not the design. WDR exposes that.

Re: Show HN: This website is valid JSON

#22
post #17
post #10

This is a really cool hack. > The JSON must contain only pure information without any concern about design or markup. Wellll.. I mean the json has markdown syntax in it. That's a lot nicer than html tags for markup, but it's still markup. In case anyone reading hasn't seen it before, browsers have a thing called XSLT built into them that does something similar for XML documents. You serve up your data as XML, add a t…

Yeah, I thought about using XML/XSLT too, but I think JSON would be more aligned with today's tools. Also, the render could be written in React or Vue, and add all the functionalities of a modern web app, for example, not just HTML.

Definitely your tooling is better incarnation of the idea, XSLT is kind of an abomination

Re: Show HN: This website is valid JSON

#23
post #20

I'm curious about caching potential with this approach. Meaning: If the javascript (and other content) loaded via #render is highly cacheable, can this lead to pages that display as soon as the JSON is loaded?

I tested only on small websites, but the performance that I am experienced surprised me a bit. The render is very small and fast and as you said, like the JSON page (that it is also very small because there aren't any HTML tags), very cacheable. More testing is needed.

Re: Show HN: This website is valid JSON

#24
post #21
post #16

This is an interesting technical hack, but I have to ask what problem this is aiming to address?

I created this tool with a very odd necessity: I hate animations and overlay ;). I would like to have access to the website data directly and build my own interface, but for this, I would have to have access to the information only. I know that the website could expose an API, but WDR feels much more natural and easy (try to do a `fetch` on the page and get the JSON instantly). Now that I have built and have played a…

This makes a lot of sense and I agree with this need! I want to throw in a healthy dose of skepticism about whether your solution can address that need -- only because I hope that hearing it early can increase your chances of success!

I think a hard problem ahead would be how to convince other people to also adopt this framework, and how to make sure that people are using the same JSON keys to mean the same thing. I'm a little skeptical that this can happen on its own, because we've already tried a standard that was supposed to designed to convey just the content of the website without the presentation -- HTML.

I'm curious how you plan to prevent your JSON format from being (ab)used for presentation purposes, where people add extra content to make the page display a certain way. And if you have a plan, is this plan feasible using HTML as well?

Re: Show HN: This website is valid JSON

#25
You know, I once had a resume powered by JSON. It was rendered to a PDF (and HTML) but the syntax was backed by JSON. This was years back and I shudder to even recall the idea.

I didn't create the project mind you, it was some NPM package back when I was a fresh 'un who didn't have thoughts on using a billion subdependencies

Anyway, I was nearly broke and when I went to apply for the benefit, I was asked for my resume as a word doc

Clearly, you can imagine how this conversation went down but I had brought a PDF on a USB which I offered to print out instead.

The clerk refused to let me plug in my USB for fear I was going to "hack" her and the HTML page, saving as a PDF with Chrome, took some convincing to ask her to navigate to so it could be printed

I guess the lesson here is that if you expect to run out of funds, make sure you have your most essential documents stored via Microsoft Word?

Re: Show HN: This website is valid JSON

#26
post #9

I'm confused about: > The JSON must contain only pure information without any concern about design or markup. All the design and markup required to render the page must be inside the rendering script. The source code has markup in the form of Markdown, e.g. ## or * text

Yes, this is a good catch. The reason for this is the basic render that I created is generic, and it is not what you should do to render your JSON. The render should fit perfectly with the JSON. The basic render is just for a quick start.

For example, the basic render "# Title" creates an h1 header, but if you created the render, you know the internal schema of the JSON, so you can use the correct HTML element for that without recurring to this hack.

But the principle is important: try not to use markup on the JSON, because this would make it difficult for others to consume your website with JSON.

Re: Show HN: This website is valid JSON

#27
post #22
post #17

Earlier quoted context omitted.

Yeah, I thought about using XML/XSLT too, but I think JSON would be more aligned with today's tools. Also, the render could be written in React or Vue, and add all the functionalities of a modern web app, for example, not just HTML.

Definitely your tooling is better incarnation of the idea, XSLT is kind of an abomination

Yeah, I don't have very fond memories about it.

Re: Show HN: This website is valid JSON

#28
post #25

You know, I once had a resume powered by JSON. It was rendered to a PDF (and HTML) but the syntax was backed by JSON. This was years back and I shudder to even recall the idea. I didn't create the project mind you, it was some NPM package back when I was a fresh 'un who didn't have thoughts on using a billion subdependencies Anyway, I was nearly broke and when I went to apply for the benefit, I was asked for my resum…

I’ve generally saved my HTML resume to PDF without any major issues as a professional SWE for the past ~15 years or so, although I’ve been dealing primarily with SV tech companies and not government agencies in the UK.

Microsoft Word is fine too but I would still use something like PDF for export and sharing (still not sure how Microsoft Word solves the usb problem for you).

Generally though I like something text-like that I can revision control more easily/edit in vim. Maybe I’ll switch to something like pan doc going forward (then you can generate word if they really want it).

Re: Show HN: This website is valid JSON

#29
post #10

This is a really cool hack. > The JSON must contain only pure information without any concern about design or markup. Wellll.. I mean the json has markdown syntax in it. That's a lot nicer than html tags for markup, but it's still markup. In case anyone reading hasn't seen it before, browsers have a thing called XSLT built into them that does something similar for XML documents. You serve up your data as XML, add a t…

I think Blizzard used to do this way back on their website.
Post reply on HN