Skip to content

Digital frame streaming photos from Instagram with a Raspberry Pi

Notifications You must be signed in to change notification settings

eexwhyzee/frame_pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Instagram Frame

Creating a digital slideshow frame with a Raspberry Pi that streams photos from your favorite Instagram accounts.

Materials

Raspberry Pi Setup

I won't go into too much detail of getting Raspbian set up since there's a ton of guides available online.

Once I got Raspbian up and running, I ran these commands to make sure everything is up to date:

sudo apt-get update

sudo apt-get upgrade 

sudo apt-get dist-upgrade 

sudo apt-get install raspberrypi-ui-mods 

sudo apt-get install raspberrypi-net-mods 

Setting up the Scripts

I'll be grabbing photos from Instagram using the Instagram-Scraper, which can be installed using pip:

pip install instagram-scraper

Instagram-Scraper allows you to download photos in a variety of ways, including usernames and hashtags. When executed, the shell script download_igPhotos.sh will grab photos from a couple of my girlfriend's favorite instagram accounts.

In the slideshow.sh shell script, I went with feh to run my slideshow.

Disable Sleep

In order to have the screen running the slideshow without going to sleep, I installed XScreensaver using:

sudo apt-get install xscreensaver

After XScreensaver is installed, click on the Menu button (top left corner) of the desktop GUI and go to Preference > Screensaver and set the mode to "Disable Screen Saver" from the drop menu.

Boot to slideshow

X must be running for XScreensaver to work so I've added startx into my .bashrc and launch xscreensaver into .xsessionrc.

To boot straight into the slideshow, the slideshow.sh script must be added into .xsessionrc. Here's an example of how the .xsesionrc file should look like:

#! /bin/bash
xscreensaver &
/home/pi/frame_pi/slideshow.sh

At this point, the Raspberry Pi successfully turns on and boots straight into a slideshow of images collected from the desired Instagram accounts!

Using CRON to Update the Image Folder

To keep things new and interesting instead of the same images all the time, I used CRON to automatically delete past images and download new images from Instagram every 3 days.

Edit your crontab with crontab -e and add these lines:

0 0 */3 * * sudo /home/pi/frame_pi/download_igPhotos.sh 
0 0 */3 * * find /home/pi/frame_pi/photos/ -type f -name "*.jpg" -mtime 3 -exec rm{} \;

About

Digital frame streaming photos from Instagram with a Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages