Well, after pouring through oodles of Flickr API documentation (you wanna talk about how an API should be written? Get back to me after you have seen how awesome Flickr’s is), staring at the possibilities of wedging another CMS’s gallery plugin into MODx, attempting to bribe you all, and even contacting developers of similar plugins...
I decided to write my own.
It’s heavily based on phpFlickr, so PEAR is needed. Since privacy is not a concern for my need, I haven’t even begun looking into public v. private on Flickr. Finally, I still can’t make it public yet, since I am not caching anything locally, which is apparently a no-no.
That being said, here are the huge benefits to my simple little script:
- My code is only 78 lines long. That’s heavily commented and spaced out fairly well.
- It will be very very VERY simple to convert into a MODx Snippet.
- The codebase is independent of any one system. In other words, we can share it with the world.
But before I do that, I need some help. First, I will need some beta testers. I’m asking in advance because this will be a pretty kickass addition to MODx, but I don’t want a support nightmare...I’m just not that good at PHP yet.
Second, I need someone who is decent at being able to look for security holes. I don’t want to unleash this to the world and then realize I just gave everyone access to your computers.
Finally, I need to figure out two minor things when running this code in MODx:
1. If I am going to create a cache within the snippet, I need to tell ti where to dump images from the Flickr servers. Where should I tell it to dump, and how can I call that variable easily within a snippet?
2. How can I declare the server path to the page the snippet is being run on, and how can I call the exact page the snippet is being run on? The script will call the same page three times (for album, thumbnails and large image) and I need to know how to tell it to come right back to where we are.
That’s it! I hope to have this online soon, so I would love some feedback. My goal is to make it very simple to use, and very simple to implement. So far, all you need is to declare your Flickr Username and then you are done!
Take a look at the rough cut here and let me know what you think:
http://www.johnvilsack.com/flickr/gal.php
Finally, my goal is to make some forward and back previews of images, as well as cull a bit more information from the servers. In true Web 2.0 fashion, I promise to release it with a very nice looking template (gradients and everything!) and I have even toyed with the possibility of throwing in some Asynch Javascript to limit the amount of page reloads.
Hrmm...Asynch Javascript parsing XML data. That sounds like something someone should come up with a catchy name for
Thoughts and feedback are appreciated!
- John