Options

In search of thumbnails

jfriendjfriend Registered Users Posts: 8,097 Major grins
I'm working on sprucing up a greasemonkey add-in for Firefox that makes statcounter hit displays a lot more friendly by displaying relevant thumbnails. The general theme of the add-in is that it parses the URLs that recorded a hit and finds a relevant thumbnail image for that URL and then inserts that into the statcounter page.

When doing this I encounter a number of URLs that get hits that I don't have a thumbnail for because there's no imageID and imageKey in the URL. I'm wondering if there is a way to retrieve a useful image that goes with the following URLs:

A category URL: http://jfriend.smugmug.com/Kenya
Is there a way to construct a URL that will fetch the thumbnail associated with the category?

A sub-category URL: http://jfriend.smugmug.com/Kenya/568323
Is there a way to construct a URL that will fetch the thumbnail associated with the sub-category?

An image URL that doesn't have an imageKey in it: http://jfriend.smugmug.com/gallery/5608869_vwzCG#344290515
Is there any way to construct a URL that will fetch a thumbnail for the image with imageID=344290515 when I don't have the imageKey? I know the gallery number from the URL and the gallery is public so it's not like it's a security issue. There are, unfortunately, some Smugmug URLs that show the image, but don't contain the imageKey.
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

  • Options
    photobyaaronphotobyaaron Registered Users Posts: 45 Big grins
    edited August 19, 2008
    Hi there! I have no technical expertise to help you with unfortunately, but I just wanted to say what a great idea that is and I hope you find a way to make it work. I'll be checking back later to see if you've got it together.
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 19, 2008
    Hi there! I have no technical expertise to help you with unfortunately, but I just wanted to say what a great idea that is and I hope you find a way to make it work. I'll be checking back later to see if you've got it together.

    This is probably what you want: http://www.dgrin.com/showthread.php?t=73366. It was worked on by a couple of us. Originated by someone else, then spruced up by me. I find it very useful when looking at the Visitor Paths page in StatCounter.

    I did figure out that an URL like http://jfriend.smugmug.com/photos/random.mg?AlbumID=4774058&Size=Tiny&AlbumKey=ZrL8r&rand=3841 can fetch a thumbnail for a gallery.

    Still no idea how to get a thumb for a category or for a public gallery without a galleryKey.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited August 19, 2008
    jfriend wrote:
    Still no idea how to get a thumb for a category or for a public gallery without a galleryKey.

    I don't think there is a way to do this ne_nau.gif
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 19, 2008
    devbobo wrote:
    I don't think there is a way to do this ne_nau.gif
    That's a bummer for me.

    Of course, I wouldn't have to do this at all if the gallery links in the UI always had the galleryKey in them, but sometimes they do not. There are places where an URL refers to a specific image and it doesn't have the imageKey in the URL too. It makes it really messy and unsatisfying to do any parsing of Smugmug URLs. Before the galleryKey and imageKey were added, Smugmug URLs had a real nice programming symmetry to them, nice and ordered and easy to construct or parse to do what ever you wanted. The addition of imageKey and galleryKey did not preserve that elegance unfortunatly.

    That means that it's no longer programmatically possible to always see a "visited URL" (in a page hit recorder like StatCounter) and programmatically construct a thumbnail image for the image that the visitor was looking at. That can be a really useful thing to do when looking at image hit statistics in one of these page hit tools like StatCounter.

    These are all public galleries so there isn't any security vulnerability without knowing the galleryKey or imageKey. They are all accessible via scraping web pages or via the public Smugmug APIs.

    If anyone at Smugmug wants to see an example of where the imageKey is missing from the URL, here's one:

    Go to: http://cmac.smugmug.com/gallery/2504559_f3ta9. Where it says "1 of 48 Next", click on the Next link. After doing that, the URL will be http://cmac.smugmug.com/gallery/2504559_f3ta9#131480975. While that URL refers to one particular image that the viewer is viewing the large size of, the URL contains the galleryID, galleryKey and imageID, but no imageKey. http://cmac.smugmug.com/gallery/2504559_f3ta9#131480975_ef3J9 would be the whole URL with all IDs and keys. That's the URL you get if you click on the thumb to get to the image.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited August 20, 2008
    jfriend wrote:
    If anyone at Smugmug wants to see an example of where the imageKey is missing from the URL, here's one:

    Go to: http://cmac.smugmug.com/gallery/2504559_f3ta9. Where it says "1 of 48 Next", click on the Next link. After doing that, the URL will be http://cmac.smugmug.com/gallery/2504559_f3ta9#131480975. While that URL refers to one particular image that the viewer is viewing the large size of, the URL contains the galleryID, galleryKey and imageID, but no imageKey. http://cmac.smugmug.com/gallery/2504559_f3ta9#131480975_ef3J9 would be the whole URL with all IDs and keys. That's the URL you get if you click on the thumb to get to the image.
    Good catch John. I'll fix that up...hopefully this week. thumb.gif
    Pedal faster
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 20, 2008
    bigwebguy wrote:
    Good catch John. I'll fix that up...hopefully this week. <img src="https://us.v-cdn.net/6029383/emoji/thumb.gif&quot; border="0" alt="" >

    Cool!

    For completeness, here are all the URL issues I see that are affecting my StatCounter report. The first one and maybe the second one are the most important to me because they seem to happen a lot more frequently:
    • If you click on the left and right arrows above or below the photo (the ones that say "< 1 of 202 >", you don't end up with an imageKey in the resulting URL (this is the one I already mentioned)
    • If you use the right and left arrows to advance through the gallery in Smugmug view, you only get #imageKey in the URL
    • In the filmstrip view, when you click on a thumb to show a new image, the URL doesn't change at all. I expected it would have #imageID_imageKey on the end of it like happens in the Smugmug view.
    • In the filmstrip view, clicking on a thumb does not trigger a new page view in StatCounter (and probably some of the other page counters) like it does in the Smugmug view.
    • If you click on the main image from filmstrip view or critique view, you get a single image view overlaid on top. If you then use the "< 1 of 202 >" navigation in that single image view, you don't get a different URL as you navigate and you don't get page hits in StatCounter.
    • When you first switch into Critique view, you are only looking at one image, but there's no #imageID_imageKey in the URL, just the gallery ID and key.
    --John
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited August 20, 2008
    jfriend wrote:
    Cool!

    For completeness, here are all the URL issues I see that are affecting my StatCounter report. The first one and maybe the second one are the most important to me because they seem to happen a lot more frequently:
    • If you click on the left and right arrows above or below the photo (the ones that say "< 1 of 202 >", you don't end up with an imageKey in the resulting URL (this is the one I already mentioned)
    • If you use the right and left arrows to advance through the gallery in Smugmug view, you only get #imageKey in the URL
    • In the filmstrip view, when you click on a thumb to show a new image, the URL doesn't change at all. I expected it would have #imageID_imageKey on the end of it like happens in the Smugmug view.
    • In the filmstrip view, clicking on a thumb does not trigger a new page view in StatCounter (and probably some of the other page counters) like it does in the Smugmug view.
    • If you click on the main image from filmstrip view or critique view, you get a single image view overlaid on top. If you then use the "< 1 of 202 >" navigation in that single image view, you don't get a different URL as you navigate and you don't get page hits in StatCounter.
    • When you first switch into Critique view, you are only looking at one image, but there's no #imageID_imageKey in the URL, just the gallery ID and key.
    --John
    first two will get fixed. the others will have to wait until we update those gallery styles.
    Pedal faster
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 20, 2008
    bigwebguy wrote:
    first two will get fixed. the others will have to wait until we update those gallery styles.
    Thanks.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    bwgbwg Registered Users, Retired Mod Posts: 2,119 SmugMug Employee
    edited August 22, 2008
    jfriend wrote:
    Thanks.
    should be all set John.
    Pedal faster
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 22, 2008
    bigwebguy wrote:
    should be all set John.
    Looks great. Thanks. It's much easier to deal with URLs consistently now.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.