Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 
©2007-2009 ~kargath64
:iconkargath64:

Artist's Comments

So what is this, exactly?

deviantAUTOSORTER is a Perl script that automatically scans a directory full of images you've saved from deviantART and categorises them into subdirectories according to the deviant who made them.
It was born out of a need when I had been clearing my 8,000-strong devWATCH and I had been saving a lot of images - over a thousand, in fact. I certainly didn't want to sort them manually (which I had been doing previously on a smaller scale), and so deviantAUTOSORTER was born.


So ... how do I use it?
First off, you'll have to download the script file using the "Download" link to the left. Save it to an easily-typable location (such as c:\scripts\deviant_sorter.pl).
Next, you'll need Perl if you don't have it already. If you're running Linux, there's a very good chance you've got it already - if not, consult your distribution's particular instructions to find out how to retrieve Perl and install it on your system. For Windows, the official Perl distribution is ActivePerl, available at [link] .
Once you've gotten Perl installed, open up a command line interpreter. There's no standard way to do this on Linux (hell, there's no standard way to do ANYTHING on Linux), but in Windows go to Start>Run, and then type "cmd" and press OK.
Navigate to the directory that all your pictures are in. In both Linux and Windows, the command "cd BLAH" changes to the directory BLAH, whilst "cd .." changes to the directory above the directory you're in. (A better option is to use the "Open Shell Here" option of your operating system if you have it. In Windows, this can be achieved by downloading the "Open Command Window Here" PowerToy, available at [link] .)
Once there, simply type "perl SCRIPTPATH" into your command shell and press ENTER. SCRIPTPATH is the exact path to where you saved deviantAUTOSORTER (such as "c:\scripts\deviant_sorter.pl").
The script should run (you may notice a large spike in hard-drive activity due to the massive amount of moving the script may perform), and you will be presented with messages on progress as well as any errors encountered.

An additional option I've not yet tested is copying the script to the directory that you want it to stuff around with, and then double-click it. No idea on your kilometreage with that one, really, but it may be worth a shot. (You won't see any errors, though...)

Warnings and Caveats
The trick that the script uses to sort the files in the directory relies on the way that deviantART automatically renames images sent to it. For example, if I submit a JPEG picture with a deviation title "Lizard Faerie", the image should be renamed to "Lizard_Faerie_by_kargath64.jpeg". The script pattern matches the filenames for this structure and finds the deviant name from it, and it is this information that is used in sorting.
Only files which have been properly renamed by deviantART and not renamed by you when saving it will work with this script. Some deviants such as =Neolucky's deviation file titles are just scrambled numbers and letters and will not work with this script. In addition, tutorial files, downloads, and almost all very old deviations are not under this filename system - so they won't be compatible with it either.

This script requires the existence of the Cwd, File::Path, File::Copy, File::Spec, and File::Spec::Functions packages (which should be included in pretty much any standard Perl distro, anyway.)
I have attempted to make this script reasonably platform-independent, but that being said, I have not tested it on any other platforms than Windows. In addition, the overall testing done on the whole package is to only a moderate standard. This code is provided in the hope that someone else will find it useful, but I make absolutely no warranties as to its effectiveness. Don't blame me if your /etc/passwords gets clobbered or your harddrive turns into a chicken.


Possibilities for the Future
Although this script is pretty decent as-is, I may improve it in the future if there is demand for it. Possibilities include:
:bulletblue: Silent and verbose modes
:bulletblue: Dangerous mode (clobbers target files instead of throwing an error)
:bulletblue: Off-target directories
:bulletblue: Anything else requested! (It will never do your grocery shopping for you, though.)

Version History
1.0 - Initial Release
1.1 - Added auxillary Filename Flattener script, and fixed a very minor regex error.

Comments


love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
:icontikurion:
Very nice idea! Though I don't really save images from dA on a basis that would justify the use of this script I really think it's a neat tool.

The documentation seems to be okay as well (Linux user, so MUCH easier to set up here ; P) so, yeah, well done guess - and this is despite the fact I'm not a fan of Perl but rather of Python ^^.

--
As stated in my last journal entry, I barely frequent deviantART anymore. All my newer photos are uploaded on my homepage, which is where you can get in contact with me as well.

http://tikurion.net
:iconkargath64:
Glad you like it! Yeah, I just saw 1000+ images in the one folder and thought "there's no way in hell I'm doing THAT manually" ... then it occured to me to release it here :)
Heh, I just wanted to make this script accessible for people who don't even know what a scripting language IS. :D
I haven't tried Python (which is weird since I'm a Blender user :XD:), but I just am in love with pattern matching in Perl. :heart:

--
deviantAUTOSORT - sort your saved deviation collection in seconds!
:icontikurion:
Well, 1000+ pictures are worth writing such a script. Not one of those "I'd be quicker if I did this by hand but I'll rather write a script"-projects XD.

Perl is a very powerful tool, no debate on that, but Python makes some tasks so utterly easy but to top that off it does so in an easy way too ^_~.

--
As stated in my last journal entry, I barely frequent deviantART anymore. All my newer photos are uploaded on my homepage, which is where you can get in contact with me as well.

http://tikurion.net
:iconboffinbrain:
Wow... You download a lot of stuff. :o Still, for those that do, it sounds like a great app.
:iconkargath64:
Thanks! and those are some interesting scripts you've done yourself :)

--
deviantAUTOSORT - sort your saved deviation collection in seconds!
:iconkargath64:
[link] :p

--
deviantAUTOSORT - sort your saved deviation collection in seconds!
:icontikurion:
I absolutely love xkcd! That comic of course matches wonderfully XD.

--
As stated in my last journal entry, I barely frequent deviantART anymore. All my newer photos are uploaded on my homepage, which is where you can get in contact with me as well.

http://tikurion.net
:iconkargath64:
From time spent with awk I totally distrust whitespace as a semantic construct >_>

--
deviantAUTOSORT - sort your saved deviation collection in seconds!
:icontikurion:
Yeah, it can be quite a problem, but hey, problems exist so they can be solved, don't they ; ).

--
As stated in my last journal entry, I barely frequent deviantART anymore. All my newer photos are uploaded on my homepage, which is where you can get in contact with me as well.

http://tikurion.net

Details

November 18, 2007
2.1 KB
2.4 KB
112×41

Statistics

12
5 [who?]
1,171 (0 today)
48 (0 today)

Site Map