rlm@11: #!/usr/bin/perl rlm@11: rlm@11: rlm@11: use File::Find; rlm@11: use Set::Object; rlm@11: use List::Util 'shuffle'; rlm@11: rlm@11: use Image::Size; rlm@11: rlm@11: $header = < rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: Judy Yates - Prints rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: Judy Yates -- Wildlife and Pets on Stone rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11:
rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11:
rlm@11: rlm@11:
rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11:
rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: HERE rlm@11: ; rlm@11: rlm@11: rlm@11: rlm@11: $pics = Set::Object->new(); rlm@11: rlm@11: open PHOTOS, '>/home/r/Desktop/web/judyates/photos.html'; rlm@11: select PHOTOS; rlm@11: rlm@11: rlm@11: @include = rlm@11: ( rlm@11: '/home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/photos/large' rlm@11: ); rlm@11: rlm@11: rlm@11: find(\&accept_type,@include); #grab all the jpeg files rlm@11: rlm@11: @pics = $pics->elements(); rlm@11: rlm@11: #@pics = shuffle(@pics); rlm@11: rlm@11: rlm@11: foreach $id(0..$#pics) rlm@11: rlm@11: { rlm@11: rlm@11: $pics[$id] =~ m/(.*\/)([^\/]*)$/; rlm@11: $lrgpath = $1; rlm@11: $src = $2; rlm@11: $lrgpath =~ m/^(.*\/)[^\/]*\/$/; rlm@11: $path = $1; rlm@11: $thumbPath = $path."thumbs/"; rlm@11: $filetype = "image"; rlm@11: rlm@11: ($width, $height) = imgsize($path.$src); rlm@11: rlm@11: ($lrgwidth, $lrgheight) = imgsize($lrgpath.$src); rlm@11: rlm@11: rlm@11: $title = $src; rlm@11: $author = 'Judy Yates'; rlm@11: $copyright = 'Copyright Judy Yates Artist 2010'; rlm@11: $description = $src; rlm@11: $forsale = "true"; rlm@11: $paytype ='paypal'; rlm@12: $ButtonID = "RAYAWZUUTJ79E"; rlm@11: rlm@11: rlm@12: $numOfPrices = 3; rlm@12: rlm@11: $price1 = '25'; rlm@11: $pricecurrency1 = 'USD'; rlm@11: $pricecurrencysymbol1 = '$'; rlm@12: $pricesize1 = '8"x10" Photo Print'; rlm@12: rlm@12: $price2 = '35'; rlm@12: $pricecurrency2 = 'USD'; rlm@12: $pricecurrencysymbol2 = '$'; rlm@12: $pricesize2 = '11"x14" Matted Print'; rlm@12: rlm@12: $price3 = '40'; rlm@12: $pricecurrency3 = 'USD'; rlm@12: $pricecurrencysymbol3 = '$'; rlm@12: $pricesize3 = '11"x14" Signed Matt'; rlm@12: rlm@12: rlm@12: rlm@12: rlm@12: rlm@11: $imgid = $id; rlm@11: rlm@11: rlm@11: $megaString[$id]= " rlm@11: rlm@11: { rlm@11: 'filetype' : '$filetype', rlm@12: 'ButtonID' : '$ButtonID', rlm@11: 'path' : '$path', rlm@11: 'src' : '$src', rlm@11: 'width' : '$width', rlm@11: 'height' : '$height', rlm@11: 'lrgwidth' : '$lrgwidth', rlm@11: 'lrgheight' : '$lrgheight', rlm@11: 'lrgpath' : '$lrgpath', rlm@11: 'title' : '$title', rlm@11: 'author' : '$author', rlm@11: 'copyright' : '$copyright', rlm@11: 'description' : '$description', rlm@11: 'forsale' : $forsale, rlm@11: 'paytype' : '$paytype', rlm@11: 'price1' : '$price1', rlm@11: 'pricecurrency1' : '$pricecurrency1', rlm@11: 'pricecurrencysymbol1' : '$pricecurrencysymbol1', rlm@11: 'pricesize1' : '$pricesize1', rlm@12: rlm@12: 'price2' : '$price2', rlm@12: 'pricecurrency2' : '$pricecurrency2', rlm@12: 'pricecurrencysymbol2' : '$pricecurrencysymbol2', rlm@12: 'pricesize2' : '$pricesize2', rlm@12: rlm@12: 'price3' : '$price3', rlm@12: 'pricecurrency3' : '$pricecurrency3', rlm@12: 'pricecurrencysymbol3' : '$pricecurrencysymbol3', rlm@12: 'pricesize3' : '$pricesize3', rlm@12: rlm@12: rlm@11: 'numOfPrices' : '$numOfPrices', rlm@11: 'imgid' : $imgid, rlm@11: }, rlm@11: rlm@11: "; rlm@11: rlm@11: #print "@megaString"; rlm@11: rlm@11: rlm@11: #`$command2`; rlm@11: rlm@11: } rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: $maingalleries = " rlm@11: maingalleries = rlm@11: [ rlm@11: {'name':'Judy Yates Photos', rlm@11: 'imgpath': '$path', rlm@11: 'lrgpath': '$lrgpath', rlm@11: 'thumbpath': '$thumbPath', rlm@11: 'mainthumb': '$path', rlm@11: 'src':'mainthumb.jpg', rlm@11: 'description':'Awesome Photos From Judy Yates.', rlm@11: 'start':0, 'end':$imgid, rlm@11: 'gallerynum':1} rlm@11: ]; rlm@11: rlm@11: rlm@11: var galleryimages = new Array(); rlm@11: rlm@11: "; rlm@11: rlm@11: rlm@11: print $header; rlm@11: rlm@11: rlm@11: $maingalleries =~ s#/home/r/Desktop/web/judyates/#./#g; rlm@11: rlm@11: rlm@11: print $maingalleries."\n"; rlm@11: rlm@11: print "galleryimages = [\n"; rlm@11: rlm@11: for (@megaString) { rlm@11: s#/home/r/Desktop/web/judyates/#./#g; rlm@11: print;} rlm@11: rlm@11: print "\n];\n"; rlm@11: rlm@11: print $footer; rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: sub accept_type rlm@11: { rlm@11: rlm@11: /.svn$/ and $File::Find::prune = 1; rlm@11: rlm@11: /.jpg$/i and $pics->insert($File::Find::name); rlm@11: rlm@11: rlm@11: rlm@11: rlm@11: } rlm@11: