It looks like you're using an Ad Blocker.

Please white-list or disable AboveTopSecret.com in your ad-blocking tool.

Thank you.

 

Some features of ATS will be disabled while you continue to use an ad-blocker.

 

Help: Need script for Raspberry Pi digital photo frame

page: 1
1

log in

join
share:

posted on Dec, 29 2019 @ 04:12 PM
link   
So I wanted a digital frame, and they were crazy expensive. So I bought a Raspberry Pi 4 and a monitor. The Google Photos slideshow option is stupid fast, and can't be changed.

I found this script online to just auto change the photos without using slideshow. I am using Greasemonkey on firefox.
Website: paulstamatiou.com...

// ==UserScript==
// @name google photos slower slideshow
// @namespace piframe
// @include photos.google.com...*
// @version 1
// @grant none
// ==/UserScript==

// CHANGE first_photo TO USE THE URL OF THE FIRST PHOTO IN YOUR ALBUM
var first_photo = 'https://photos.google.com/album/XXXX/photo/XXXX';

// how often to change photo, in seconds
var interval = 60;
function pressKey() [
var key = 39; // right arrow keycode
var ke = new KeyboardEvent("keydown", [
bubbles: true, cancelable: true, keyCode: key
]);
document.body.dispatchEvent(ke);
]
function next_or_prev() [
var current_url = window.location.href;
pressKey();
// I think there is a race condition with the URL updating after keypress, so we need to delay this slightly.
setTimeout()[
if (current_url == window.location.href) [window.location.href = first_photo;]
], 100);
]
window.setInterval()[next_or_prev()], interval * 1000);

The problem is it does not work. Anyone know why?

I used the URL of my google photo album and put it in place of the * for album name, and I used the URL of the photo in place of the * for photo name.



posted on Dec, 29 2019 @ 04:25 PM
link   
a reply to: OccamsRazor04

var interval = 60

Isn't that milliseconds ?



posted on Dec, 29 2019 @ 04:33 PM
link   
a reply to: StallionDuck

Perhaps use Setinterval or setTimeout?

function timeout() [
setTimeout(function () [
count += 1;
console.log(count);
timeout();
], time);
];
timeout();



posted on Dec, 29 2019 @ 05:21 PM
link   
a reply to: StallionDuck

Seconds it says. The 1000 on bottom is milliseconds. (that's what it says at least)



posted on Dec, 29 2019 @ 05:46 PM
link   
a reply to: OccamsRazor04

That's where I would be confused. 1000ms = 1s

Seems like the number would be 60000 for 60 seconds.

Don't take my word for it though. I only really 'edit' C# code. I never put the time in to actually write the stuff myself. I can do basic all day long, surprisingly still from many, many years ago but new coding languages - not so much. I can break it down and edit them to my needs but my mental database isn't that large. Though... Still... It has it's similarity to basic enough to where I can at least get into trouble.



posted on Dec, 29 2019 @ 06:04 PM
link   
a reply to: StallionDuck

The interval variable is multiplied by 1000. The code is _javascript. SetTimeout in _javascript is milliseconds.

Does the page show nothing or it just does not advance the slideshow? I really do not understand what you mean by "it does not work".



posted on Dec, 29 2019 @ 06:18 PM
link   
a reply to: OccamsRazor04

*sigh* ... let me create a google photos account and ill debug this in firefox. This code should work across pretty much all browsers the same. Its not like its coded in raspian for petes sake...



posted on Dec, 29 2019 @ 07:01 PM
link   
a reply to: OccamsRazor04

I dont see any problems with this code unless maybe you were not authenticated to the site in the browser to begin with.

The last function I would write more like this if it was pure _javascript but I dunno how this would pan out with greasechimp.

paste bin link to code how I would write that last function

I just found out you cannot link pastebin I guess.....

Truly though, I think this should be written into googles photos API to authenticate, retrieve a list of albums, allow you to set the albums in a config file either permissive or dismissive in an array. Then retrieve an array of all photos per album and iterate through them all using the REST methods and _javascript xhr get/post requests. You can do it!! If you need help on that one let me know.


edit on 29-12-2019 by drewlander because: (no reason given)

edit on 29-12-2019 by drewlander because: (no reason given)



posted on Dec, 29 2019 @ 07:11 PM
link   
a reply to: drewlander
I can only imagine Google changed something. I've decided to just not stream the photos and use a flash drive. Now I just need Kodi running smoother.



posted on Dec, 29 2019 @ 07:30 PM
link   
a reply to: OccamsRazor04

the script actually worked for me so I dont think its a google thing. Maybe a firefox version thing or something though. I wouldnt stream for the sake of bandwidth on my hi res photos. If you want to access a local or network storage and display files in a browser window you could code this pretty easy with python.
edit on 29-12-2019 by drewlander because: (no reason given)



posted on Dec, 29 2019 @ 07:32 PM
link   
a reply to: OccamsRazor04

Whatta ya know... its already out there.

github.com...



posted on Dec, 29 2019 @ 07:52 PM
link   
a reply to: drewlander

Thank you I will look at that!



posted on Dec, 29 2019 @ 10:54 PM
link   
Why not just a screensaver to your photos?




top topics



 
1

log in

join