smugmug.albums.get - enhanced filtering

ebswiftebswift Registered Users Posts: 94 Big grins
I see that smugmug.albums.get has a lastupdated filter which is great, so can I now suggest that we get filtering on ALL attributes? Here's an example looking for albums that can be viewed externally, aren't passworded and contain images:

http://api.smugmug.com/services/api/rest/1.2.2/?method=smugmug.albums.get&NickName=ebswift&APIKey=myapikey&SessionID=mysession&Passworded=0&External=1&HasImages=1

Incidentally, that filter would also filter out entire categories (by virtue of being a list of albums) that have nothing public to show.

If all attributes had filtering available, this could extend to keyword searching, title searching and all kinds of other goodies that would have all kinds of uses without performing initial caching into a searchable form.

Try Smugfoto in Facebook for displaying your SmugMug galleries.

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited July 16, 2009
    I was actually playing around with something like this recently.

    On the method smugmug.users.getTree (version 1.2.2), there is a hidden boolean parameter 'Empty' which filters out empty categories/subcategories when set to false.

    It should be pretty straightforward to implement this for albums, but I need to make sure it scales ok performance-wise for accounts with a lot of galleries.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited July 16, 2009
    Thanks for considering this David, I look forward to seeing if it's viable.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 22, 2009
    I'm completely new to the API, but it seems like what you guys are talking about here may be the direction in which I have to learn.

    I'm trying to pull all the album names/keys for a particular category. This will be fed into the random image generator each time a visitor comes to my web site, so I can pull a random image/video from a gallery and display it.

    I know there's going to have to be some 'glue' code to go between everything, but the part that I'm most interested in here is what you guys are talking about it pulling album names. I know at one point someone wrote a program that would pull the gallery names so you could link to the images from a regular html page, but I can't seem to find that.

    Any assistance appreciated.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited July 28, 2009
    Hi SamirD, maybe you could use the info from here (?):

    http://wiki.smugmug.net/display/SmugMug/Random+Photos+Code

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 28, 2009
    I've looked at that code and it helps somewhat. I've actually worked with the API and have it doing what I want aside from some small issues. Now, I've got to write some code to feed a random album to the random image generator and use the result for what I want.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
Sign In or Register to comment.