edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [edbrowse-dev] json what to do
@ 2018-05-06 11:45 Karl Dahlke
  2018-05-06 12:22 ` Dominique Martinet
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Dahlke @ 2018-05-06 11:45 UTC (permalink / raw)
  To: edbrowse-dev

I know almost nothing about json so bear with me.

Open your Bibles please to

https://www.ibm.com/us-en/

Don't browse, just look at the html.

,s/></>\n</g

To make it readable.

Ok, the last script in the head section

<script type="application/ld+json">

What is that? I'm sure it's there for a reason. We need to know what to do with it.
I gathered it up into a string and passed it to JSON.parse() in duktape and it parses just fine.
That returns the corresponding javascript object.
All good, but what am I suppose to do with this object?
If I just feed this string to JSON.parse, that object gets thrown away. It all gets thrown away.
Unless I store it somewhere, but where?
The script doesn't specify a variable for me to put it in.
Do I put it under some property under the script object?
Any help appreciated.

Karl Dahlke

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [edbrowse-dev] json what to do
  2018-05-06 11:45 [edbrowse-dev] json what to do Karl Dahlke
@ 2018-05-06 12:22 ` Dominique Martinet
  0 siblings, 0 replies; 2+ messages in thread
From: Dominique Martinet @ 2018-05-06 12:22 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: edbrowse-dev

Karl Dahlke wrote on Sun, May 06, 2018:
> <script type="application/ld+json">
> 
> What is that? I'm sure it's there for a reason. We need to know what to do with it.

I don't think we need to do anything with it, it apparently is for
search engines

Here's a link to what google has to say about such "structured data":
https://developers.google.com/search/docs/guides/intro-structured-data

Basically it tells them how the site is structured, for the ibm websites
it has a "SearchAction" that lets ibm pick how google should search
within the site, if I understand that correctly...

I don't know if actual scripts in the page should be able to access it
but that seems fairly useless for browsers, I think we're safe to ignore
it

-- 
Dominique

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-06 12:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 11:45 [edbrowse-dev] json what to do Karl Dahlke
2018-05-06 12:22 ` Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).