Unix command line uploader project

neuronneuron Registered Users Posts: 30 Big grins
Hi,

Since I choosed smugmug as my web album base (thank you all the people creating such wonderfull site), I am looking for a means of uploading images. I have quite a few of them. And since I like the simplicity and power of unix commandline, here we go :)

There already exists smugup, which got me inspired, but I would like to focus on several differences.

a) Run anywhere. I'm using POSIX shell, sed etc. utilities. It's working on solaris as it is working on linux.
b) Use wget instead of curl, as wget is more common than curl is (again I'm having solaris worksatation, which lacks curl).
c) Use latest api (1.2.0)

Currently I can upload multiple images with the (attached) script.

The final revision should take your photos directory tree, and synchronize it to smugmug (creating the galleries & categories as it goes through the tree). Later if you change (add/delete/modify) some photographs, the script should reflect those changes on smugmug (uploading only new and modified photographs and not everything again).

I wrote some sort of REST framework in the shell, so if you would like to have other abilities, let me know.

I'm releasing first public version (as an attachment to this thread), what do you think ? :deal

Thanks again for smugmug
--
neuron

Comments

  • NimaiNimai Registered Users Posts: 564 Major grins
    edited July 23, 2008
    I just wrote a series of curl, grep, awk statements to do the opposite of this - download a whole gallery. But I didn't do it in a very flexible way. It's more of a scrape of the All-Thumbs gallery view.
    Command line tools would be a great addition to the Smug arsenal. I'll definitely have a look.
  • neuronneuron Registered Users Posts: 30 Big grins
    edited July 24, 2008
    Nimai wrote:
    I just wrote a series of curl, grep, awk statements to do the opposite of this - download a whole gallery. But I didn't do it in a very flexible way. It's more of a scrape of the All-Thumbs gallery view.
    Command line tools would be a great addition to the Smug arsenal. I'll definitely have a look.
    Well, we might find common functionality and make sort of 'library' and build the rest on the top of this in one package. I just registered project on sourceforge, later today I want to upload the script to svn.

    Thanks
    --
    neuron
  • bokbaardbokbaard Registered Users Posts: 10 Big grins
    edited August 5, 2008
    awesome ideas.
    This way I can loop/pipe stuff directly from my local "smug" mimmicking repo of images, directly into my smug.
  • neuronneuron Registered Users Posts: 30 Big grins
    edited August 5, 2008
    bokbaard wrote:
    awesome ideas.
    This way I can loop/pipe stuff directly from my local "smug" mimmicking repo of images, directly into my smug.
    Thanks ! I'll announce some more usable release here later. In the meantime I founded http://sourceforge.net/projects/smugmugsh
  • neuronneuron Registered Users Posts: 30 Big grins
    edited August 11, 2008
    Update
    Hi,

    the development is slowly going forward. With my last putback http://smugmugsh.svn.sourceforge.net/viewvc/smugmugsh I have the engine prepared for categories and subcategories manipulation (querying and creating). It's about the time to put it together with image uploading. Question is what should be the layout of files on disk ? I can think of several types. To ilustrate, let's say that smugmug.sh is executed with directory name

    smugmug.sh dir

    Now if

    a) the dir is full of jpeg files, I will create gallery named "dir" in category "Other" and upload all the images

    b) the dir has directories inside which contain images
    dir -> folder a
           -> folder b
           ....
    
    I will create category "dir" and upload galleries "folder a" and "folder b" with category "dir"

    c)
    dir -> subdir -> folder a
    
    This would mean category "Dir", subcategory "subdir" and gallery named "folder a"

    Would you think off any other layout

    Thanks

    --
    neuron
  • zooloozooloo Registered Users Posts: 7 Big grins
    edited August 12, 2008
    neuron wrote:
    Hi,

    Since I choosed smugmug as my web album base (thank you all the people creating such wonderfull site), I am looking for a means of uploading images. I have quite a few of them. And since I like the simplicity and power of unix commandline, here we go :)

    There already exists smugup, which got me inspired, but I would like to focus on several differences.
    neuron wrote:
    The final revision should take your photos directory tree, and synchronize it to smugmug (creating the galleries & categories as it goes through the tree). Later if you change (add/delete/modify) some photographs, the script should reflect those changes on smugmug (uploading only new and modified photographs and not everything again).
    I like the idea, and I have been toying with exactly the same thing (even the name smugmugsh 8-) ) but haven't gotten that far. Naturally, it's easier to dream of ideas than to implement them 8-)

    I was also thinking a FUSE-based filesystem "smugmugfs" would be cool, but it turns out that's been started too ( http://code.google.com/p/smugmugfs/ ). There isn't any code yet.

    I haven't been using SmugMug long, but I've quickly become frustrated with some of the basic limitations. The CLI tools will help alleviate some of the pain, and I hope your project matures quickly. Your work will help the rest of us save time.

    Thanks for sharing.
  • neuronneuron Registered Users Posts: 30 Big grins
    edited August 12, 2008
    zooloo wrote:
    I like the idea, and I have been toying with exactly the same thing (even the name smugmugsh 8-) ) but haven't gotten that far. Naturally, it's easier to dream of ideas than to implement them 8-)
    Thank you for your support, it's nice to know that I'm not doing something completely crazy :)

    zooloo wrote:
    I was also thinking a FUSE-based filesystem "smugmugfs" would be cool, but it turns out that's been started too ( http://code.google.com/p/smugmugfs/ ). There isn't any code yet.
    That looks like a neat idea also, though I can see some implementation details issues. Well, we will see I guess.

    zooloo wrote:
    I haven't been using SmugMug long, but I've quickly become frustrated with some of the basic limitations. The CLI tools will help alleviate some of the pain, and I hope your project matures quickly. Your work will help the rest of us save time.
    Thanks for your kind words. Frankly I'm not yet 100% sure to go with smugmug also, since I don't seem to be able to name my galleries with my national characters, and generally make them bi-lingual easily (I know that tere are some CSS hacks out there, but haven't played with the idea yet). Other thing is that it seems to be sometimes quite slow (displaying images). But since smugmug owners granted me the Pro account, I want to first give something back and then we'll see.
  • neuronneuron Registered Users Posts: 30 Big grins
    edited September 2, 2008
    First usable version
    Hi,

    I have first usable version. Grab it from here: http://sourceforge.net/projects/smugmugsh/

    Usage is simple. First create your directory layout

    mkdir /somewhere/galleries
    cd /somewhere/galleries
    mkdir -p Animals/dogs/events Animals/dogs/my_dogs
    mkdir -p Sports/bike
    mkdir unsorted
    cp *.jpg Animals/dogs/events
    cp *.jpg Animals/dogs/my_dogs
    cp *.jpg Sports/bike
    cp *.jpg unsorted

    Then upload galleries

    $ smugmug.sh -g /somewhere/galleries


    You should get four galleries created

    Animals->dogs->events
    Animals->dogs->my_dogs
    Sports->bike
    Other->unsorted


    If it breaks, I would like to hear it, If it's usefull to you I would like to hear it too :)

    Oh, and if there are any issues, turn on '-d' commandline option and send me the output (erasing your password !)

    Things I want to do
    * support for image description (I want to convert my old gallery with descriptions to smugmug)
    * use api 1.2.2 (currently it's 1.2.0)

    Anything else ?
Sign In or Register to comment.