I'm looking for a way to extract google photos comments. Is there any official way through the API? Any alternatives?
Thanks Z
I'm looking for a way to extract google photos comments. Is there any official way through the API? Any alternatives?
Thanks Z
The method below will extract comments (and other useful info) from a Google Photos album. This worked on an M1 MacAir running Excel for Mac 16.55 (365 subscription)
Sub extractGooglePhotoInfo()
Dim s As String, path As String, ext As String
Dim tempWk As Workbook, tempR As Range
Dim sh As Worksheet, r As Range, t As String
ext = "json"
Set sh = ThisWorkbook.ActiveSheet
Set r = sh.Range("A1")
r.Offset(0, 0) = "file name"
r.Offset(0, 1) = "description"
r.Offset(0, 2) = "image views"
r.Offset(0, 3) = "photo taken"
r.Offset(0, 4) = "url"
Set r = sh.Range("A2")
s = Dir(ThisWorkbook.path & "/*." & ext)
While s <> ""
path = ThisWorkbook.path & "/" & s
Workbooks.OpenText path, , , xlDelimited
Set tempWk = ActiveWorkbook
Set tempR = tempWk.ActiveSheet.Range("A1")
t = tempR.Offset(1, 0): r.Offset(0, 0) = Mid(t, 13, Len(t) - 14) 'title
t = tempR.Offset(2, 0): r.Offset(0, 1) = Mid(t, 19, Len(t) - 20) 'description
t = tempR.Offset(3, 0): r.Offset(0, 2) = Mid(t, 18, Len(t) - 19) 'imageViews
t = tempR.Offset(10, 0): r.Offset(0, 3) = Mid(t, 19, Len(t) - 19) 'photoTaken
t = tempR.Offset(26, 0): r.Offset(0, 4) = Mid(t, 11, Len(t) - 12) 'url
Set r = r.Offset(1, 0)
tempWk.Close False
s = Dir()
Wend
*Note: the code formatting above is strange because I couldn't get the code formatting features to work with code copied directly from the Mac version of the VBA editor.