MicrostockGroup
Microstock Photography Forum - General => General Stock Discussion => Topic started by: melastmohican on June 03, 2009, 12:43
-
Finally I decide to streamline my upload workflow. I have been using sitecopy for months but I was always manually picking files for upload before running it. I decided that it takes too much time. Script modifications allow me to run in from task scheduler at 1AM.
1. Pick 10 random files from my ready images (no repetitions from series should happen)
2. Upload with sitecopy to all the sites in the list
3. Move uploaded images to backup location (I am thinking about putting backup on Amazon S3)
In the morning it does not take long to submit 10 images on every site.
-
How do you pick the 10 random files?
-
I will publish my bash script on my blog when I feel that it is working well. In words it takes count of files in directory and generates random number which is index of file in the list.
FILES=($(ls))
COUNT=${#FILES[@]}
for i in {1..10}
do
INDEX=`expr $RANDOM % $COUNT`
RANDOMFILE=${FILES[$INDEX]}
echo "$i $RANDOMFILE"
done
-
you can also do it in PHP.
-
Most of programming languages got some sort of random number generation built in
-
Most of programming languages got some sort of random number generation built in
no no i mean the whole script.
-
Why would I use web scripting language for uploading? Images are my my local hard drive and I want to pick some of them and upload to multiple ftp sites. All tools are available on desktop: scripting language, ftp clients. If I want to use cannon to kill a fly I would write a program :-) Some hard core programmers would even write ftp client :-)
-
Why would I use web scripting language for uploading? Images are my my local hard drive and I want to pick some of them and upload to multiple ftp sites. All tools are available on desktop: scripting language, ftp clients. If I want to use cannon to kill a fly I would write a program :-) Some hard core programmers would even write ftp client :-)
believe me with PHP it's a matter of few lines of code
to manage ftp uploads, file renaming, deletion, etc
and you can compile the PHP into an .exe as well if you
really want it desktop-run.
-
I must admit I did not know that. I guess I can just do /usr/bin/php script.php from command line ;-)
-
It has been working so far. I can finish submission on all sites during my morning coffee time :-) It's pretty random so I am always surprised when I see what photos were upload last night.