Closed erbridge closed 1 year ago
It would be nice if we can find a tool (browser plugin?) that detects if a page you have has a compatible ld+json feed - be v useful for placecal organisers
We could knock a browser extension together for that very easily, I think.
i was thinking of using an existing one but our own one would have lots of benefits to be sure - if it just spots and gives you the correct link that would save a shitload of errors for admins im guessing. esp as the vendor list grows it would prob save a lot of time for people.
started looking into this https://crxjs.dev/vite-plugin
detecting events will probably be something like
[...document.querySelectorAll('script[type="application/ld+json"]')]
.map(el => el.innerHTML)
.filter(str => str.includes('"@type": "Event"')) // do something nicer here probably with lodash
.length > 0 // true if has events
However, I think the browser extension is the least important part of this. Let's spawn a new issue for that.
So we try fetching a URL and if the response is HTML then we attempt to scan it for ld+json content?
I'm a little concerned that although ld+json is well structured in specific records there's an infinite variety of nesting structures that will have to be dealt with. i.e. we have two importers (Dice and OutSavvy) that are both ld+json but are just different enough to warrant their own extraction logic.
Isn't this what the library we're using is for? To standardise the data structures by "expanding" or "compacting"? If they're being compliant with the standards, we should be able to implement a common parser that works for any standard-compliant implementation.
Do we have a list of known ld-json sources we can use to test the third criteria? It seems like it may be a bit open ended as an AC
I am closing this now as we can find example problem sites as we move forward.
User story
As an organiser, I need to import the events of partners, so that they appear on PlaceCal.
Acceptance criteria
Implementation notes & questions
Prompted by #1444 seeming to also use ld+json, but not be a Squarespace site.
Implementation plan
To be written by the developer