PageRenderTime 73ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/???????/e????/h-picasa-upload.rb

https://bitbucket.org/hirono_hideki/hirono_hideki.bitbucket.org
Ruby | 37 lines | 31 code | 3 blank | 3 comment | 4 complexity | 4f3f3d21c77729531e3cf438bc661549 MD5 | raw file
  1. #!/home/h272/.rbenv/shims/ruby -Ku
  2. DIR = Dir::pwd
  3. ANAME = DIR.sub("/home/h272/git/hirono_hideki.bitbucket.org/","")
  4. puts ANAME
  5. cfile = `ls *.jpg`
  6. list = DIR.sub(/^.+\//,"") + ".list"
  7. if File.exist?(list) then
  8. filelst = `cat #{list}`
  9. cfiles = Array.new
  10. cfiles = cfile.split("\n")
  11. lfiles = Array.new
  12. lfiles = filelst.split("\n")
  13. newfile = Array.new
  14. newfile = cfiles - lfiles
  15. newfile.sort!
  16. newfile.each do |f|
  17. `google picasa post #{ANAME} #{f}`
  18. end
  19. else
  20. newfile = Array.new
  21. newfile = cfile.split("\n")
  22. newfile.sort!
  23. for i in 0..(newfile.size-1)
  24. if i == 0 then
  25. print "????????????\n"
  26. # `google picasa create -n #{ANAME} #{newfile[i]}`
  27. sleep 10
  28. else
  29. print ">>>> ",newfile[i],"\n"
  30. # `google picasa post #{ANAME} #{newfile[i]}`
  31. end
  32. end
  33. end
  34. `ls -tr *.jpg > #{list}`