Can this be done through the API?

jhofkerjhofker Registered Users Posts: 136 Major grins
I've been slowly reading through the API doc trying to figure out if I can complete my scenario. I'm hoping someone more familiar with it. Hoping someone can help me out with an answer!

I want to get all public photos by a specific user inside a specific date range without authentication.

Is that doable? From the api docs, smugmug.images.get looks like my best bet, but it appears to only fetch images for a specific gallery, which is not what I want. Ideally I'll be able to pull EXIF info for the photos as well, but I think smugmug.images.getEXIF has me covered there.

My other thought was to use RSS feeds, but they don't appear to be queryable (kinda the point, I suppose!) nor does it go back far enough.

I'd appreciate any thoughts!

Comments

  • MSkaffariMSkaffari Registered Users Posts: 147 Major grins
    edited November 8, 2011
    jhofker wrote: »
    I've been slowly reading through the API doc trying to figure out if I can complete my scenario. I'm hoping someone more familiar with it. Hoping someone can help me out with an answer!

    I want to get all public photos by a specific user inside a specific date range without authentication.

    Is that doable? From the api docs, smugmug.images.get looks like my best bet, but it appears to only fetch images for a specific gallery, which is not what I want. Ideally I'll be able to pull EXIF info for the photos as well, but I think smugmug.images.getEXIF has me covered there.

    My other thought was to use RSS feeds, but they don't appear to be queryable (kinda the point, I suppose!) nor does it go back far enough.

    I'd appreciate any thoughts!

    Ho about this?

    You could first get albums that have been changed since specified time using smugmug.albums.get and provide the LastUpdated parameter to get only recently changed albums.
    Then you could fetch images that have been updated after specified time using smugmug.images.get and provide LastUpdated parameter to get only recently changed or uploaded images.

    If you wish to do exact timing you would need to pull EXIF from the images and arrange them accordingly.
  • jhofkerjhofker Registered Users Posts: 136 Major grins
    edited November 8, 2011
    Hmm, I think that would mostly work. If I want a week's worth of photos from back in August (say, the 7th-13th), I'd have to:
    albums.get -> userInfo, LastUpdated == 8/7/2011
    foreach album, where album.LastUpdated <= 8/13/2011:
        photos.get -> albumid/key, LastUpdated == 8/7/2011
        foreach photo, where photo.LastUpdated <= 8/13/2011:
            photos.getExif -> photoid/key
    

    That will likely work, but it feels like a lot of API calls for what I wish was just a generic collection of photos per user.

    Ah well, thanks for the tip, Miikka! I'll try to get this added to my app when I have some free time.
  • MSkaffariMSkaffari Registered Users Posts: 147 Major grins
    edited November 9, 2011
    jhofker wrote: »
    Hmm, I think that would mostly work. If I want a week's worth of photos from back in August (say, the 7th-13th), I'd have to:
    albums.get -> userInfo, LastUpdated == 8/7/2011
    foreach album, where album.LastUpdated <= 8/13/2011:
        photos.get -> albumid/key, LastUpdated == 8/7/2011
        foreach photo, where photo.LastUpdated <= 8/13/2011:
            photos.getExif -> photoid/key
    

    That will likely work, but it feels like a lot of API calls for what I wish was just a generic collection of photos per user.

    Ah well, thanks for the tip, Miikka! I'll try to get this added to my app when I have some free time.

    I agree, not pretty. I'll ad this to the list of things to consider for the next versions of the API.
  • jhofkerjhofker Registered Users Posts: 136 Major grins
    edited November 9, 2011
    Thanks again. Please let me know if you are looking for vNext API feedback at any point.
  • MSkaffariMSkaffari Registered Users Posts: 147 Major grins
    edited November 15, 2011
    jhofker wrote: »
    Thanks again. Please let me know if you are looking for vNext API feedback at any point.

    Actually you can get EXIF data for the images with Extras parameter in smugmug.photos.get call. This saves you a lot of calls as you don't have to fetch data for each image separately.
  • jhofkerjhofker Registered Users Posts: 136 Major grins
    edited November 15, 2011
    Good call, I'll add that.
Sign In or Register to comment.