02. October 2017 · Comments Off on Piwigo to RSS · Categories: Programming · Tags: , , ,

Ok, this is another wildly specific hack but on the off chance there’s another human trying to do the same thing: here’s a file you can download if you’re using Piwigo to host your images and you want to send a feed of random images from one category to a program via RSS. In my case, I love using John’s Background Switcher (JBS) to show pictures I’ve taken as background photos. JBS is one of those programs that does one thing and does it very well. It can pull files from a variety of popular hosting services, I started using it back when I had my photos on Flickr. Here’s how you can point it to your Piwigo instance.

Piwigo is a program you can use to host your photos on your very own website, it also works well and reliably. JBS can pull from some well known RSS formats, and Piwigo actually supports RSS but it’s very limited. JBS can pull a feed and pick a random image from that list, but I have a LOT of images I want displayed, so needed some glue. Enter this “Piwigo to RSS” feed. All it does is call Piwigo’s public API and get 20 (or whatever you set) random photos from one category. I have a category I use for favorite photos, so I point it there. JBS then reads that feed and voila: randomly chosen background image from your very own list of favorite photos.

Instructions

  1. Run an instance of Piwigo on your web server and install JBS on your computer.
  2. Download a copy of the file located at www.ardenstone.com/projects/piwigorss/piwigo_rss.txt. Save a copy of this locally and change it from .txt to .php.
  3. Edit the file in a text editor. There are only four lines you need to change. The lines that start with “//” are comments, they should tell you what to change. You’re basically pointing this file to your webserver and telling it what category to use. Since this uses Piwigo’s public API you don’t have to set any passwords, users, etc.
  4. Put the file somewhere on your webserver. It doesn’t really matter where as long it’s a folder that can host public PHP files.
  5. Navigate to that file through a web browser. If it’s working you’ll get an RSS feed of your photos. If you refresh it, you should get a new random list of photos. If you haven’t seen an RSS feed before it won’t look very pretty from a web browser, but as long as it’s not throwing obvious errors and you can see some thumbnail photos and links it’s probably working.
  6. Go into JBS (on a PC you right-click on the icon) and go into Settings. Select “Add” and “RSS photo feed”. Enter the URL that points to the Piwigo to RSS file.
  7. Enjoy your fancy new photo feed!

Huge thanks to John who wrote JBS. He made a great program, has supported it for years, kindly answered some questions I had when trying to hack this together, and even added showing dates from the RSS feed.

Comments closed.