The Obsidian Web Clipper

Re The Obsidian Web Clipper.

Experimenting with clipping data using the IMDb template, which gets a year value from "{{schema:datePublished|split:\\\"-\\\"|slice:0,1}}".

This extracts the year from the publishing date, not the year of release. For example, for The Fabelmans, it returns 2023, although the film was released in 2022.

Have tried schema.org copyrightYear but that doesn’t return a value.

Grateful for any tips or solutions.

Kepano’s template was updated last month and since then, Obsidian’s Web Clipper has evolved quite a bit :grin:
So, I can only guess that some things that were potentially needed in the very early stages of the Web Clipper’s development could not necessarily be needed anymore :blush: .

This seems to work for me though :innocent: :

{{schema:datePublished|split:"-"|first}}

or this:

{{schema:datePublished|date:("YYYY", "YYYY-MM-DD")}}

I can’t guarantee it’ll work for everything on IMDb as I’ve only quickly tested these with 2 movies on Chrome :innocent:

1 Like

Thank you. They both get the year from the date the entry was created on IMDb, not the actual year of release (unless the year is the same as the publication year, of course).

Will keep trying. Must be a solution. But very grateful for the support.

:star_struck:

That could be a browser thing :thinking:

On Chrome, on my old & dying Mac, both return 2022 and the key datePublished I see in the DevTools is 2022-11-23

But the with the same IMDb page opened on Arc, the DevTools states for the key datePublished2023-01-27 :sweat_smile:

So, Kepano’s template was working as expected :smile:

I’ll keep looking because this is a bit surprising to me …

1 Like

Many thanks for the help.

If I do a simple search for The Fabelmans (without opening the specific page), I see the title as being The Fabelmans 2022, with the year being important because of distinguishing between films with the same titles or remakes.

Until now, I have used Christian’s QuickAdd Movie Script, which for the same film returns 2022, not 2023, using year:: {{VALUE:Year}}. So somewhere along the line it seems that the two clippers are reading different dates. I assumed that Kepano’s clipper was reading an IMDb publishing date, not a release date, but perhaps I have got that wrong.

It’s a tiny issue and easily checked and corrected whenever a new note is created, but I would prefer to get the template right if I can … and I think that Christian’s call to the data is picking out the right date: in the one example, the film was originally released in 2022 according to every other source I have seen. For sure the film might have had theatrical releases in 2023 in other countries, but I really want to get the original year as that is used in naming conventions on the net.

Have been scouring for different field values but nothing I have tried so far has worked.

Will post a solution if I ever find one.

Thanks, again.

:partying_face:

OK so, it’s not necessarily a browser thing and also not a clipper thing per se … It’s a language/locale thing :upside_down_face: … I think :see_no_evil:

My old & dying Mac isn’t set in English but the movie details I get on IMDb (down in the page), tells me that it was released on November 23, 2022

… While this is what I get on Arc, on my more recent Mac (which is set in English) :upside_down_face:

I can suggest this horrible thing though :sweat_smile: :

{{selector:#__next > main > div > section.ipc-page-background.ipc-page-background--base.sc-afa4bed1-0.iMxoKo > section > div:nth-child(5) > section > section > div.sc-9a2a0028-3.bwWOiy > div.sc-70a366cc-0.bxYZmb > ul > li:nth-child(1) > a}}

Edit: it can be simplified as:

{{selector:div.sc-70a366cc-0.bxYZmb > ul > li:nth-child(1) > a}}

It picks up the year at the top of the page, just under the title :blush:
At least, it worked on Arc when I tested on 2 movies :innocent:

I have no idea if it can be simplified or if there’s another way to get there :see_no_evil:
I just began to look at what one can find in the DevTools when looking at what’s underneath a website :sweat_smile:

1 Like

Correction :see_no_evil:: It’s a browser language thing :innocent:

After setting Arc to use English (United States) for my Preferred language (as opposed to English (United Kingdom) before), IMDb now also states, automatically, that the movie was released on November 23, 2022 :blush: … (date which is then send somewhere in the schema, underneath the hood)

1 Like

Thank you so much for the time and effort and detailed replies. That insanely pretty kitty deserves a cape and a giant S on its chest. :cat2: :superhero:

Looking at the page source, there is a datePublished value, which on my Mac is:

"datePublished":"2023-01-27"

Which corresponds, I think, to Kepano’s code:

{{schema:datePublished|split:"-"|slice:0,1}}

But there is also a separate releaseYear:

{"text":"The Fabelmans","__typename":"TitleText"},"certificate":{"rating":"12A","__typename":"Certificate"},"releaseYear":{"year":2022,"endYear":null,"__typename":"YearRange"},

I (think I) understand the issue with the browser language and datePublished picking up regional data, but I think it should be possible to target the releaseYear separately.

{{schema:releaseYear}}

Christian’s code does get the release year, but I can’t figure out how that works. Still trying.

https://www.omdbapi.com

1 Like

Looking at the template variables:

Template variables can be used to automatically pre-populate data from the page in a template. Variables can be used in the note name, note location, properties, and note content. Use the ... icon in the extension popup to access the current page variable for use in templates. There are several types of variables you can use: preset variables, meta variables, selector variables, and schema variables.

… I can see that releaseDate is not available.

Your earlier suggestion, as copied below, works:

{{selector:div.sc-70a366cc-0.bxYZmb > ul > li:nth-child(1) > a}}

And it seems this slightly shorter version also works.

{{selector:div.sc-70a366cc-0.bxYZmb > ul > li:nth-child(1)}}

After all of that, I think I will stick with Christian’s QuickAdd script for now as that also gets the duration as a simple number of minutes, which I have not been able to do with the OWC.

Thank you for all the help, patience, and kindness today.

:star_struck: :trophy: :raised_hands:

1 Like

You’re too kind :see_no_evil: … I just did what I could :blush:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.