zenphoto forums » General Zenphoto Discussion

ZenPhoto RSS Reader / Parser

(4 posts)
  • Started 4 years ago by nickchapman
  • Latest reply from acrylian
  1. nickchapman

    Apprentice
    Joined: Mar '10
    Posts: 3

    I wanted to make a little script that displays thumbs of my latest ZenPhoto additions. I decided using RSS was the way to go.

    The code isn't included yet or anything, but it basically uses SimplePie (RSS Parser) to pull information from the ZenPhoto RSS feed. I had to make some adjustments to get it to display correctly...nothing extensive, or that a novice PHP programmer couldn't figure out with a little time and effort, but thought it may help someone.

    Here's the working example:

    http://chapmanit.thruhere.net/picture_rss/

    Obviously, the linked 'demo' galleries are working examples of the parser in action. I've gotten it to work on all feeds I've attempted with the exception of the main ZenPhoto Demo Gallery...due to problems caused by the images all having the same upload / taken date/time. I didn't dedicate much time to fixing this since it shouldn't affect many people.

    I then decided to see if I could get it to work with other RSS feeds...and with minimal effort got it to work with Flickr and Picasa feeds.

    I'll post the source code if any interest is expressed. I'll clean it up a little, make it presentable.

    --

    FYI, only the thumbnails at the top are script I'm referencing...the rest of the page content is practically a dump of the SimplePie-parsed RSS feed.

    This script is running on my development server, which is slow...so don't be surprised if other RSS feeds take a few seconds to load...and may require a reload if it times out. I've not seen it not work on the second load.

    Nick C
    http://ChapmanIT.com

    Posted 4 years ago #
  2. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 15,148

    In case it is of interesst, we use this script for displaying the Zenphoto news within the admin backend overview page.
    http://www.scriptol.com/rss/rss-reader.php

    Don't forget to read the Forum rules and usage resources
    Posted 4 years ago #
  3. nickchapman

    Apprentice
    Joined: Mar '10
    Posts: 3

    Thanks! Even though the SimplePie includes aren't very large, I'd like to streamline the code as much as possible so will look into the scriptol option you mentioned as well as the XML parser that comes with PHP 5+...if the included tools work, ya know?

    I've made lots of progress with the project since the last reply. It is now hosted here. I've made quite a few changes and improvements. Still having some trouble with ZenPhoto Albums...I think it is due to how the URLs are encoded when Albums are specified.

    The code now offers a 'widget' for basic html embeds (via iframes). I'm planning on offering a more advanced PHP return system soon so that coders can actually format and style the pictures as they'd like, instead of relying on the few optiosn available through the HTML embed URL call, but haven't got there yet. Please visit the page and add a comment if this is something that you'd like to see!

    The project has become a catch-all for Photo Feeds (RSS/Atom)...but I'm alright with that. ZenPhoto holds a special place in my heart, but I use Flickr regularly and Picasa Web for different purposes, as well.

    It even works with other galleries such as Plogger and Gallery2/3...but that was really just luck. Didn't take much extra coding and I thought I might as well.

    Check it out!

    Posted 4 years ago #
  4. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 15,148

    Regarding encoding of urls we have a function named pathurlencode that does not encode the slashes which is a problem in XML. Look at the rss feeds, rss-functions.php and the new sitemap-exented plugin, maybe someting of that is of use, too. (There must be a better way than iFrames?).

    Note that Zenphoto's code generally is not PHP 5 only (although with the next release we plan to skip explicitly PHP 4 support). So if you use PHP5 only code, please state that explicity the version needed to avoid confusion.

    I will add an entry on our extensions page for this.

    Don't forget to read the Forum rules and usage resources
    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.