#!/usr/bin/tclsh set dir [exec pwd] set homeDir $dir set dir_length [string length $dir] set author "kplawver" set status "Publish" set allow_comments 1 set convert_breaks 0 set allow_pings 0 set other_catlist [list] set now [clock seconds] set date [clock format $now -format "%m/%d/%Y %r"] set category_block "" set fileList [glob -nocomplain $dir/*] set dir_list [list] foreach file $fileList { if {[file isdirectory $file]} { lappend dir_list $file } } set return "" foreach dir $dir_list { if {![file exists $dir/images] && ![file exists $dir/Images]} { continue } set count 0 set category [string range $dir [expr $dir_length + 1] end] set fileList [glob -nocomplain $dir/images/*] foreach file $fileList { if {[file extension $file] != ".jpg"} { continue } set fileName [file tail $file] catch { exec cp $dir/images/$fileName $homeDir/images exec cp $dir/thumbnails/$fileName $homeDir/thumbs } incr count incr now set date [clock format $now -format "%m/%d/%Y %r"] set file [file tail $file] append return "-------- AUTHOR: $author TITLE: $category: Image $count STATUS: $status ALLOW COMMENTS: $allow_comments CONVERT BREAKS: $convert_breaks ALLOW PINGS: $allow_pings PRIMARY CATEGORY: $category DATE: $date ----- BODY: ----- EXTENDED BODY: ----- EXCERPT: ----- KEYWORDS: $file ----- " } } puts $return