Options

keyword change? 3 character minimum?

2»

Comments

  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited December 5, 2009
    Ham1 wrote:
    I can put you in touch with an event photographer or two that say filename keywording is critical to their business.

    The right thing for us to do a long time ago was put the option to disable/enable the feature, which we now have inside the Control Panel
    >Settings
    >Site Privacy & Security

    Markham
    An improvement to the current on/off switch (which is a good step forward) would be an "auto" option (as the default) that detects standard-conforming out-of-camera filenames and doesn't index those parts. Then, even users who have no idea about keywords or this customization option would avoid accidentally polluting their keyword database.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    alacraneraalacranera Registered Users Posts: 77 Big grins
    edited December 5, 2009
    Andy wrote:
    Devbobo is a SmugMug sorcerer, and if he says he can fix you, he will deal.gif

    Thanks to Devbobo, Andy and Ham1 for responses. Now, if one of you could answer my actual question, I'd be grateful.

    I did not ask anybody to fix me. I asked if there was any wildcard, or other, tool that will in bulk (or even semi-bulk) select, for removal, the trash keywords Smugmug has auto-generated?

    It's all spiffy and swell and stuff that Devbobo has removed jfriend's trash keywords. But since he "spent a few hours" at it, I'm guessing it was more or less a tedious image by image process. If I am guessing wrong, and there is some way to partly automate the tedium, could you share that in this forum, please?

    我在微笑不告诉
  • Options
    alacraneraalacranera Registered Users Posts: 77 Big grins
    edited December 5, 2009
    On a not completely unrelated note...
    There is still no mention of the keywords change in Smugmug's release notes. I only learned of it in a completely unrelated forum, fredmiranda.com, where people are complaining of smugmug's poor handling of keywords. Ham1 responded there yesterday, but I see he's been kicked off that forum, as of today.

    I am trying to politely suggest that when folks go to other forums to get answers, maybe it's a hint that you guys at smugmug are not being very effective on your own forum.

    I'd really, really like to like Smugmug. But all I get are evasive, smug non-answers, which makes liking smugmug difficult.
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited December 5, 2009
    alacranera wrote:
    evasive,
    You're kidding, right? Show me a company that's more transparent :D

    We really want to help you. Please wait for Devbobo to reply, thanks.

    We'll update release notes, I promise. We always do, and always have. This change is only recent.
  • Options
    knykny Registered Users Posts: 33 Big grins
    edited December 5, 2009
    alacranera wrote:
    Thanks to Devbobo, Andy and Ham1 for responses. Now, if one of you could answer my actual question, I'd be grateful.

    I did not ask anybody to fix me. I asked if there was any wildcard, or other, tool that will in bulk (or even semi-bulk) select, for removal, the trash keywords Smugmug has auto-generated?

    It's all spiffy and swell and stuff that Devbobo has removed jfriend's trash keywords. But since he "spent a few hours" at it, I'm guessing it was more or less a tedious image by image process. If I am guessing wrong, and there is some way to partly automate the tedium, could you share that in this forum, please?

    我在微笑不告诉

    If you can run a python script, this will do the trick for you.
    From the command line, to remove all numeric keywords from a specific gallery, enter
    # python remove_numeric_keywords "My Gallery Name"

    or, to remove from all galleries (be very certain you want to do this!) enter:
    # python remove_numeric_keywords

    Take this code, add your login email, password, and API KEY in the file where appropriate and save the file remove_numeric_keywords.py

    Hope this helps.
    #!/usr/bin/python
    
    ##########
    # Requirements: Python 2.6 or
    #               simplejson from http://pypi.python.org/pypi/simplejson
    ##########
    
    ##########
    # example to remove all numeric keywords from a specific gallery, call:
    # python remove_numeric_keywords "My Gallery Name"
    #   or, to remove from all galleries call:
    # python remove_numeric_keywords
    ##########
    
    #EMAIL=[Your login email here]
    #PASSWORD='[Your password here]'
    #APIKEY='[Your API Key here]'
    API_VERSION='1.2.0'
    API_URL='https://api.smugmug.com/hack/json/1.2.0/'
    
    import sys, urllib, urllib2, urlparse, hashlib, traceback
    try    : import json
    except : import simplejson as json
    
    if len(sys.argv) > 2 :
      print "Usage:"
      print "  remove_numeric_keywords.py  [album]"
      print
      sys.exit(0)
    
    album_name = '';
    if len(sys.argv) == 2 :
      album_name = sys.argv[1]
    
    def safe_geturl(request) :
      try :
        response = urllib2.urlopen(request).read()
        result = json.loads(response)
        if result['stat'] != 'ok' : raise Exception('Bad result code')
      except :
        print "Error issuing request"
        print "Request was:"
        print "  " + str(request)
        try :
          print "Response was:"
          print response
        except :
          pass
        traceback.print_exc()
        sys.exit(1)
      return result
    
    def smugmug_request(method, params) :
      paramstrings = [urllib.quote(key)+'='+urllib.quote(params[key]) for key in params]
      paramstrings += ['method=' + method]
      url = urlparse.urljoin(API_URL, '?' + '&'.join(paramstrings))
      return safe_geturl(url)
    
    result = smugmug_request('smugmug.login.withPassword', {'APIKey' : APIKEY, 'EmailAddress' : EMAIL, 'Password' : PASSWORD})
    session = result['Login']['Session']['id']
    
    result = smugmug_request('smugmug.albums.get', {'SessionID' : session})
    album_id = None
    for album in result['Albums'] :
      if str(album['Title']) == album_name or album_name == '':
        print "Removing numeric keywords from: " + album_name
        album_id = str(album['id'])
        album_key = str(album['Key'])
        result = smugmug_request('smugmug.images.get', {'SessionID' : session, 'AlbumID' : str(album_id), 'AlbumKey' : str(album_key), 'Heavy' : '1'})
        for image in result['Images'] :
          keywords = str(image['Keywords'])
          keywords = keywords.replace(',',' ')
          keys = keywords.split()
          changed = 0
          for key in keys :
            if key.replace('\"','').isdigit() :
              keywords=keywords.replace(key,'')
              changed = 1
          if changed==1 :
            result = smugmug_request('smugmug.images.changeSettings', {'SessionID' : session, 'ImageID' : str(image['id']), 'Keywords' : keywords})
    if album_id is None :
      print "That album does not exist"
      sys.exit(1)
    
  • Options
    alacraneraalacranera Registered Users Posts: 77 Big grins
    edited December 5, 2009
    Thanks much for the script, kny.

    I'm just clever enough to run a python script, but I'm a total noob to API. I applied for an API key, but while waiting for it gave myself a brief tutorial in API noobiness. It is my understanding that the API key should belong to the script, and not to the user of the script? And that it could be supplied along with the script, without jeopardizing any security?

    If that is true, I assume you have the API key that was used to develop the script. Is there any chance of sharing it?

    Thanks.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 6, 2009
    alacranera wrote:
    Thanks much for the script, kny.

    I'm just clever enough to run a python script, but I'm a total noob to API. I applied for an API key, but while waiting for it gave myself a brief tutorial in API noobiness. It is my understanding that the API key should belong to the script, and not to the user of the script? And that it could be supplied along with the script, without jeopardizing any security?

    If that is true, I assume you have the API key that was used to develop the script. Is there any chance of sharing it?

    Thanks.

    API Keys are issued automatically, reload your control panel ...it should be there.

    Otherwise, apply @ http://www.smugmug.com/hack/apikeys
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    WinsomeWorksWinsomeWorks Registered Users Posts: 1,935 Major grins
    edited December 6, 2009
    still need a keyword fix for the past w/o removing every number on site
    Ok, I'm still looking for some kind of answer in this thread that would work for me too. The new off/on thing is great (not that I've actually found it yet... did not know it existed. Usually the new stuff is mentioned right away on our homepage) BUT I still have a bunch of ridiculous keywords from before. (not just numbers, but I'll stick to that for now. I would NOT want anyone cleaning up every numerical keyword from my site for me!! I have lots of numerical keywords (such as dates, but others too) that I would like to keep. Someone other than myself is not going to be able to discern which I want to keep. Just looking at my "all keywords" page doesn't even tell ME which ones I want. I have years other than obvious ones like 2001, 2005 or 2008. (and of course, "2005" could just be a file number too, because of the site's past default) I shoot classic cars, so I also have 1938, etc. Just looking at that number on my keyword page, it could have come from a stupid file number that I do not need in my keywords, or it could be a legit. one that I put there. I'd have to go into each photo to be sure, which is nuts.

    Would there not be some way to have the site discern which keyword numbers came from filenames in the past and get rid of them, while saving ones that were purposely put there? And then also do what John said, which is exactly what I was imagining would help the future situation. Otherwise, you just have such keyword pollution on the site. I just looked up 1938, and some of the photos are indeed date-related; either they were taken in '38, or they're old cars or whatever. But a bunch of them are just there because 1938 is part of their filename... what a mess this is for every number on the site! I hope we won't find this continuing into the future.... I hope there's a way to clean up the past mess, and not person at a time. I saw the last couple posts about scripts & all, but most people are not going to be able to pull that off, including me. As a side-note: I certainly did not think this would be a site-wide setting, because there are events shoots, etc. that some people will want the filename keywording for while they don't want it for their whole site. Well... at least we're basically moving in the right direction!
    Anna Lisa Yoder's Images - http://winsomeworks.com ... Handmade Photo Notecards: http://winsomeworks.etsy.com ... Framed/Matted work: http://anna-lisa-yoder.artistwebsites.com/galleries.html ... Scribbles: http://winsomeworks.blogspot.com
    DayBreak, my Folk Music Group (some free mp3s!) http://daybreakfolk.com
Sign In or Register to comment.