Photo journalling - tracking memories using dataview and photos hosted on the cloud

Hi people!

I want to keep a photo and memories journal using dataview and obsidian. Such a dataview table would have the date of a memory as a link and an embeded memorable photo (only on the days I added one) from all notes tagged with my daily note tag #:notebook: (see image example).

My current set up works… but it breaks at some point later and the google images that I add today won’t load/render after a week or so.

  • This is a major fragility in an otherwise lovely solution to scroll through past photo memories.

Could anyone help to make this concept less fragile?

  • I have posted my templates here on the òbsidian discord server, and I will update this post when I can get the format more robust
  • my current questions are
    • Why does the photo link stop working after a time?
  • if the google linked worked, I would still want to ensure I have a back up - so in a yearly review template, one could have a reminder to export the Photo Journal note as a PDF. (edited)

  • example photo journal entry rendering the image
    Image
  • broken embedded photo links for old embedded images
    Image

Is anyone else interested in this kind of idea? How are you achieving this currently? Do you have a robust solution?

Thanks in advance!

4 Likes

Super old topic, but here’s my script for adding images directly from Google Photos.

Update - new version here.

Original post below:


Share any individual photo from your Google Photos, and copy the link. Launch the template from Templater, and paste in the share link:

It then asks what style of embed do you want - just a link to the photo, or to embed the image, with the image data being stored remotely, or save the actual image to the same folder as the note:

The script goes and gets the permanent image location and either embeds that as a 350x250 image, or save that 350x250 thumbnail locally with a link back to the original image on Google Photos.

That way the local image takes up hardly any space in your vault, and you still have a direct link to the original fullsize image

Get the code here:

2 Likes

I used to do something similar and experienced problem after problem with Google moving photos or otherwise wrecking links. I now post photos to imgur and paste a link to the photo (usually HTML which works well in 1Writer). This has worked for more than 2 years now and if you don’t want an HTML link there are a number of options. Photos can be public or private.

I definitely know the frustration with Google modifying/deprecating products. I used the method from this Stackoverflow post, where the image is still available at the same URL seven years later. (Critically to use a non-signed-in window to fetch the link.)

I don’t have the same length of history, but I can say the images are still available for me a few months later.

Interestingly I found out this morning that it also works for videos. I hadn’t tried it before.

That it is interesting and I’ll keep it in mind in case I have problems with imgur. Thank you.

Hi @AlanG, the templater script looks very nifty, thanks for posting.

three questions.

  1. do you recognise what cake I was trying to recreate in the photo above?
  2. can you help me set up the templater script?
    • I googled curl command Templater obsidian.md and checked the templater docs for curl and js commands, but couldn’t make sense of what I need to do.
  3. in the option “as an image (saved locally)”, you mentioned “save locally with a link back to the original image on google photos” - is this the private image in your personal google.photos library, or the public album archive page?

In the meantime, I appreciate sharing the Photos Direct Link chrome extension.
cheers.

Hello I was planning on doing something similar but I haven’t gotten to it yet. I like your template though. Would you mind sharing again? The discord link above does not work or else I don’t have access? If you can, thanks.

Hi @jasondavis, i hope it helps!
Daily note template

%% https://photos.google.com/search/<% tp.file.title %> %%
    %% use templates - 1) "Photo Journal" and 2) "Memorable Meals" Photo Template for Daily Note %%
- Photo Journal:: ![Photo Journal - <% tp.file.title %>](<%tp.file.cursor(1)%>)

Photo journal dataview query

```dataview
TABLE WITHOUT ID file.link as "Date", photo-journal as "Photo Journal", memorable-meals-photo as "Memorable Meals Photo"
FROM #📓 AND -"_System"
WHERE 
	photo-journal
	or memorable-meals-photo
SORT file.day desc
1 Like

awesome thanks!

Hi @dryice - just add this at the bottom of Templater’s config page:

Hi @AlanG

I added to your script an input type “banners photo” so that my google photos can be used as my daily note banner. I use templater to open today’s photos directly in the google photos search. I choose the photo, copy the share link, and then use a hotkey to insert the photo using your script.

The output looks great! Thanks for sharing your script. I have linked my changes to your github script page above.

1 Like

What a great idea, I love this! Thanks for sharing.

In your weekly note, if you have the days of the week linked in a field called “Days::”, you can paste this dataview query to show a photo journal based on your banners. This is really something nice.

[!Photo]+ Photo journal

TABLE WITHOUT ID
	link(days.file.link, dateformat(days.file.day, "ccc dd ")) as Date, 
	"![photo](" + days.banner + ")" as "_______"
 FROM "My/Journal"
 WHERE file.name = this.file.name
 FLATTEN days
 WHERE days.banner

I’m being a big n00b as I hardly use Templater but need the Google photos embed functionality! I can’t get the nice UI to show up (the one where I paste the URL of the photo). I’ve added the curl command and copied the content from the gist to a template file in the folder where I keep the templates. I tried both loading template modal and the regular insert template options but I just get the code copied into the new note. Does someone (author of the gist @AlanG?) have any suggestions on how to get this working?

Thanks in advance!! :slight_smile:

Sounds like you’ve added it as a Templater template, not as a Templater script.

The Javascript file in my post above needs to go into the Templater scripts folder (you configure that folder in Templater options).

Then your actual template should just look like this (assuming you called the file getGooglePhoto.js):

<% tp.user.getGooglePhoto(tp) %>

Hi @AlanG! Thanks so much for your prompt reply! The extra bit I needed to do wasto remove the .md extension from the script file! And the expected UX comes up :slight_smile:

I still get an error though (for both versions of the script on the gist). Any suggestions?

TypeError: Cannot read properties of null (reading '1')
    at Object.main [as getGooglePhoto] (eval at <anonymous> (plugin:templater-obsidian:1:1), <anonymous>:30:108)
    at async Promise.all (index 0)
    at async eval (eval at compile (plugin:templater-obsidian:1:1), <anonymous>:8:14)

Hi @AlanG, on your github script I just updated my comment with my banners modifications (I didn’t actually copy paste my changes previously, sorry, although I trust you have already improved your script even more than my suggestions could!).

But speaking of suggestions and improving the script… I would like the banners function to always return its output on line 2 of the document. Can you do this easily or perhaps I could spend the next month working on this one little problem :joy:

Cheers!

I’ve updated this script to remove the complex “curl” command, and the big benefit is that it now works on mobile too!

I created its own thread here:

@shriv try my new version here.

I’ve removed the dependency on Curl and it now works on mobile as well.