Lurk all you'd like, but why not register and post some pics? Registering also makes it easier to find the good stuff. Need help?

Go Back   Digital Grin Photography Forum > Support > SmugMug APIs, Hacks & Tricks
Dgrinner
Password
Register FAQ Shooters Calendar Reviews Tutorials Gallery Books Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct-07-2007, 08:47 AM   #1
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Announcing: phpSmug - A PHP Wrapper to the SmugMug API

Ladies and gentlemen, may I introduce you to a new project of mine…




phpSmug is a PHP wrapper class for the SmugMug PHP API. Whilst there esentially isn't a need for the wrapper, the intention of this class is to allow PHP application developers to quickly and easily interact with the SmugMug API in their applications, without having to worry about the finer details of the API.

phpSmug is written for PHP 4 and PHP 5, however PHP 4 support will be withdrawn at the end of the year when PHP 4 officially reaches the end of life, announced here, and then I’ll work on optimising this to take full advantage of PHP 5’s great features. Don’t worry, I will still keep the PHP 4 supporting version available for those who can’t move to PHP 5 immediately.

phpSmug is based on the great work of Dan Coulter in phpFlickr.

I intend on having two concurrently running versions of phpSmug - one for each version of the API versions SmugMug is currently supporting.

phpSmug at the moment only supports the 1.2.0 API calls, but I’m in the process of creating a branch for the 1.2.1 API calls. <del>I'll update this thread when it's available.</del>

Now I’ll let you in on a little secret - the reason I’ve created this class is I’m in the process of creating a gallery plugin for Wordpress (to be called SmugGal) that draws photos from SmugMug, very much like FAlbum draws photos from Flickr. When this is released (hopefully by 31 Oct ;-) ), it will use the 1.2.1 API.

I've contributed a huge amount of my time and code to FAlbum (I'm the second largest contributor behind the main developer), and after numerous requests, am finally working on the an equivalent for SmugMug.

To try and keep things simple, I’ve separated the API interaction code (phpSmug) from the gallery code (SmugGal).

So, if you’re a PHP application developer, and need to interact with SmugMug, please feel free to use phpSmug and drop me line to let me know what you’re up to with this class.

I'd really appreciate it is somone could add a link to phpSmug, just below Riyad Kalla's Java API link, on the wiki too.

13 Oct '07 - UPDATE: phpSmug 1.1.1, which supports rev 1.2.1 of the API ,is now available. At the moment, it only officially implements those methods detailed at http://dgrin.com/showthread.php?t=71887.

The code is in place for ALL of the functions listed on the wiki, however some of the methods haven't been implemented in the API itself, so I've not tested these, so can't be sure they'll return the correct data. At the moment, these methods are commented out and will return "Not implemented in API yet".

I'll update phpSmug 1.1.x as these methods become available.

28 Jan '08 - UPDATE: I've been a bit slack in updating this thread as I've released new revs of phpSmug. Here's a summary of recent updates:

1.0.5 / 1.1.3 - 27 Jan ‘08
- All login.with* methods now use HTTPS to ensure login information is encrypted (Ticket #14)
1.0.4 / 1.1.2 - 4 Jan ‘08
- Changing caching to ensure more consistent caching (Ticket #11)
- Changed “response” database table field type to LONGTEXT to cater for larger amounts of data. (Ticket #12)
- Fixed issue where apostrophes in cached data are not escaped correctly (Ticket #13)

9 Feb '08 - UPDATE phpSmug 1.0.6 / 1.1.4 now support the new security functionality.

10 Feb '08 - UPDATE Forgot to take into account the ImageKey returned by image_upload() and image_uploadFromURL(), and AlbumKey returned by album_create(). These functions now return an array holding the ID and key. Thanks to devbobo for pointing this out so quickly.

23 Feb '08 - UPDATE Made changes to the caching code to fix caching issue brought up by rolandk98 on this thread and to take into account 6 hour SessionID inactivity timeout.

26 Feb '08 - UPDATE Removed extra "}" from phpSmug 1.0.8. phpSmug 1.0.9 now available.

4 Mar '08 - UPDATE I've had a busy couple of afternoons quashing bugs and enhancing phpSmug further. This release sees the re-introduction of anonymous method call caching (Ticket #18), enableCache() now checks cache directory is writeable (Ticket #19), die_on_error is now acknowledged consistently. If die_on_error is NOT set, it's up to the application developer to check getErrorCode and getErrorMessage after each method call. (Ticket #20), I've added clearCache() function to easily empty the cache. (Ticket #22) and I've Stopped caching the results of failed method calls when die_on_error is set. (Ticket #23).

phpSmug 1.0.10 and phpSmug 1.1.7 now available


Enjoy.
_____________________________________
Colin Seymour
Personal Blog | Tech Blog

Last edited by lildude : Mar-04-2008 at 09:28 AM.
lildude is offline   Reply With Quote
Old Oct-07-2007, 07:25 PM   #2
Nimai
Begrinner
 
Nimai's Avatar
 
Join Date: Mar 2006
Location: Austin, TX
Posts: 441
Sounds cool!
__________________
My Site: nimai.smugmug.com
My GreaseMonkey Scripts

DGrin quotes to live by:
Baldy:
"I don't like the flash to be brighter than the room lights"
Yuri:
"try to find out what is their beauty to you"
LiquidAir:
"Pointing a flash at a wall or ceiling is like cutting a hole to make a big ol' soft window"
Nimai is offline   Reply With Quote
Old Oct-07-2007, 11:00 PM   #3
onethumb
SmugMug CEO & Chief Geek
 
onethumb's Avatar
 
Join Date: Dec 2003
Posts: 1,194
Awesome!

Blogged, posted to the mailing lists, and linked on the wiki. Make sure you enter this in the contest, too, once it's got 1.2.1 support. :)

Thanks!
onethumb is offline   Reply With Quote
Old Oct-08-2007, 12:51 AM   #4
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Will do, thanks.
lildude is offline   Reply With Quote
Old Oct-13-2007, 11:18 AM   #5
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Support for 1.2.1 of API now available.

phpSmug 1.1.1, which supports rev 1.2.1 of the API ,is now available. At the moment, it only officially implements those methods detailed at http://dgrin.com/showthread.php?t=71887.

The code is in place for ALL of the functions listed on the wiki, however some of the methods haven't been implemented in the API itself, so I've not tested these, so can't be sure they'll return the correct data. At the moment, these methods are commented out and will return "Not implemented in API yet".

I'll update phpSmug 1.1.x as these methods become available.
lildude is offline   Reply With Quote
Old Nov-15-2007, 05:13 PM   #6
encosion
quiet annoyingly pedantic
 
Join Date: Dec 2005
Posts: 100
I'm liking where this is going... And am pretty excited at the thought of SmugGal since I'm fast becoming a WordPress convert... Thanks for your time and effort, I'll be watching this!
__________________
Canon EOS 500D (Kiss X3)
85mm f/1.8, 17-50 + 28-75m
f/2.8 lenses
iMac 24" 2.8 GHz Intel Core 2 Extreme, 4Gb RAM, OSX 10.5.7
http://encosion.com/ | http://encosion.smugmug.com/
encosion is offline   Reply With Quote
Old Nov-16-2007, 02:32 AM   #7
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Bit of a delay on SmugGal

Quote:
Originally Posted by encosion
I'm liking where this is going... And am pretty excited at the thought of SmugGal since I'm fast becoming a WordPress convert... Thanks for your time and effort, I'll be watching this!

Good to hear it. There's been a bit of a delay on the first release of SmugGal due to work commitments, and also due to a change in strategy for it's implementation.

I won't get into the details just yet, but watch this space.
__________________
Colin Seymour
Personal Blog | Tech Blog | phpSmug
lildude is offline   Reply With Quote
Old Nov-19-2007, 05:01 PM   #8
plympton
Beginner grinner
 
Join Date: Sep 2007
Posts: 9
Awesome!

I've been procrastinating about finishing SmugSync (rsync for SmugMug), and now this and the h.264 support is going to push me over the top. Cool!

-Dan
plympton is offline   Reply With Quote
Old Jan-28-2008, 01:49 PM   #9
lildude
Big grins
 
lildude's Avatar
 
Join Date: Oct 2007
Location: England
Posts: 62
Revs 1.0.5 and 1.1.3 now available.

Bumped for new revs. Revs 1.0.5 and 1.1.3 now available.
__________________
Colin Seymour
Personal Blog | Tech Blog | phpSmug
lildude is offline   Reply With Quote
Old Feb-08-2008, 12:03 AM   #10
Brett Mickelson
Road Trip!
 
Join Date: Aug 2006
Posts: 115
Quote:
Originally Posted by lildude
Now I’ll let you in on a little secret - the reason I’ve created this class is I’m in the process of creating a gallery plugin for Wordpress (to be called SmugGal) that draws photos from SmugMug, very much like FAlbum draws photos from Flickr. When this is released (hopefully by 31 Oct ;-) ), it will use the 1.2.1 API.
Does this exist yet?
__________________
www.brettmickelson.com
Brett Mickelson is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Dgrin Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Times are GMT -8.   It's 10:26 AM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.