flickru 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README ADDED
@@ -0,0 +1,37 @@
1
+ Command-line tool that automatises photo/video uploads to Flickr.
2
+
3
+ Entering 'flickru <directory>' in your command line, any photos under 'directory' (and subdirs)
4
+ are uploaded to your Flickr account (interactively entered at the first time you start flickru).
5
+
6
+ Photos are identified by case-insensitive extensions: GIF, JPEG, JPG, and PNG.
7
+ Videos are identified by case-insensitive extensions: AVI, MPEG, and MPG.
8
+
9
+ The following Flickr metadata for photos (as well as videos) is set:
10
+ (1) date-taken from the file (last) modification time
11
+ (2) private, visible by friends & family, hidden for public searches
12
+ (3) safety level to safe
13
+ (4) permission for friends & family to add comments to the photo and it's notes
14
+ (5) permission for nobody to add notes and tags to the photo
15
+ (6) for videos larger than the Flickr's longer than 90s (but shorter than 500MB,
16
+ Flickr's maximum permisible size), the description will contain an annotation
17
+ about its large duration.
18
+ (7) title, geolocation, and accuracy from the owner directory's name.
19
+
20
+ Owner directory name format is given by the format 'TITLE[@LOCATION[#PRECISION]]',
21
+ where:
22
+ (1) TITLE is the desired title for the photos directly stored in the directory
23
+ (2) LOCATION is the location of the stored photos specified as either:
24
+ (a) the Wikipedia page name (whitespaces allowed) of the location (if exists) or
25
+ (b) its coordinates LATITUDE,LONGITUDE
26
+ (3) PRECISION is the Flickr geolocation precision given by one of the following
27
+ case insentitive literals: street, city, region, country, world.
28
+
29
+ Photos are classified into a photoset (existing or not) entitled with the
30
+ second-level directory name containing the photo. The photoset is arranged by
31
+ date taken (older first).
32
+
33
+ To see some examples on the directory structure recognised by flickru, please
34
+ explore the subdirectories under var/ts.
35
+
36
+ Homepage: http://rubygems.org/gems/flickru
37
+ GitHub: http://github.com/jesuspv/flickru
@@ -3,10 +3,17 @@
3
3
  #$LOAD_PATH.unshift(flickru_dir) unless $LOAD_PATH.include?(flickru_dir)
4
4
 
5
5
  require 'flickru'
6
+ require 'flickru/version'
6
7
 
7
- photo_dir = ARGV[0]
8
+ photo_dir = File.expand_path ARGV[0]
8
9
 
9
- if ARGV.length > 1
10
+ if ARGV[0] == "-h" or ARGV[0] == "--help"
11
+ Flickru.usage
12
+ exit
13
+ elsif ARGV[0] == "-v" or ARGV[0] == "--version"
14
+ puts Flickru::VERSION
15
+ exit
16
+ elsif ARGV.length > 1
10
17
  Flickru.usage
11
18
  Flickru.die __LINE__, "wrong number of arguments: #{ARGV[1,ARGV.length]}"
12
19
  elsif photo_dir.nil? or photo_dir.empty?
@@ -9,6 +9,7 @@ require 'flickru/file'
9
9
  require 'flickru/flickr'
10
10
  require 'flickru/journey'
11
11
  require 'flickru/printer'
12
+ require 'flickru/version'
12
13
 
13
14
  FlickRaw.api_key = "aaf7253e0f88f03aa59f9d3074bf2d4b"
14
15
  FlickRaw.shared_secret = "138ee268f76cd780"
@@ -18,9 +19,10 @@ module Flickru
18
19
  def Flickru.usage
19
20
  filename = File.basename __FILE__
20
21
  Printer.show "#{filename} -- Flickr upload command-line automator\n"
21
- Printer.show "usage: #{filename} <photo directory>\n"
22
+ Printer.show "usage: #{filename} [-h|--help|-v|--version] <photo directory>\n"
22
23
  Printer.show "example: #{filename} my_photos\n"
23
- Printer.show "\n#{IO.read('README')}\n"
24
+ readme = File.expand_path(File.join(File.dirname(__FILE__), '..', 'README'))
25
+ Printer.show "\n#{IO.read(readme)}\n"
24
26
  end
25
27
 
26
28
  def Flickru.die code, message
@@ -96,17 +98,3 @@ rescue
96
98
  end
97
99
 
98
100
  end # module Flickru
99
-
100
- if __FILE__ == $0
101
- photo_dir = ARGV[0]
102
-
103
- if ARGV.length > 1
104
- Flickru.usage
105
- Flickru.die __LINE__, "wrong number of arguments: #{ARGV[1,ARGV.length]}"
106
- elsif not photo_dir or photo_dir.empty?
107
- Flickru.usage
108
- Flickru.die __LINE__, "missing photo directory"
109
- end
110
-
111
- Flickru.flickru photo_dir
112
- end
@@ -75,8 +75,11 @@ module Flickr
75
75
  end
76
76
  flickr.photos.setTags :photo_id => id, :tags => ''
77
77
 
78
+ # TODO date taken should be set only for photos/videos without non EXIF metadata
78
79
  flickr.photos.setDates :photo_id => id, :date_taken => date
79
- flickr.photos.setPerms :photo_id => id, :perm_comment => 1, :perm_addmeta => 0
80
+ flickr.photos.setPerms :photo_id => id, :is_public => 0,
81
+ :is_friend => 1, :is_family => 1, # again! (mandatory) :P
82
+ :perm_comment => 1, :perm_addmeta => 0
80
83
  # TODO permission MAY be configurable
81
84
  if not loc.nil?
82
85
  flickr.photos.geo.setLocation :photo_id => id, :lat => loc.latitude,
@@ -1,5 +1,5 @@
1
1
  module Flickru
2
2
  unless defined? VERSION
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: flickru
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jesus Pardillo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-18 00:00:00 Z
13
+ date: 2012-01-03 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colorize
@@ -137,6 +137,7 @@ extensions: []
137
137
  extra_rdoc_files: []
138
138
 
139
139
  files:
140
+ - README
140
141
  - bin/flickru
141
142
  - bin/geowiki
142
143
  - lib/flickru.rb