flickr_airlift 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. data/lib/flickr_airlift.rb +5 -2
  2. metadata +5 -5
@@ -3,7 +3,9 @@ require 'net/http'
3
3
  require 'cgi'
4
4
 
5
5
  module FlickrAirlift
6
-
6
+
7
+ UPLOADABLE_FORMATS = [".jpg", ".jpeg", ".gif", ".png", ".mov", ".avi"]
8
+
7
9
  def self.download
8
10
  begin
9
11
  establish_session
@@ -46,7 +48,8 @@ module FlickrAirlift
46
48
 
47
49
  def self.upload(relative_url)
48
50
  establish_session("write")
49
- image_file_names = Dir.entries(".").find_all{ |file_name| file_name.include?(".jpg") || file_name.include?(".jpeg") || file_name.include?(".gif") || file_name.include?(".png") }
51
+
52
+ image_file_names = Dir.entries(".").find_all{ |file_name| UPLOADABLE_FORMATS.any?{ |extension| file_name.downcase.include?(extension)} }
50
53
  uploaded_ids = []
51
54
  puts "Uploading #{image_file_names.length} files:"
52
55
  sleep 1
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr_airlift
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stephen Schor
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-01 00:00:00 -05:00
18
+ date: 2011-05-04 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -66,6 +66,6 @@ rubyforge_project: nowarning
66
66
  rubygems_version: 1.3.7
67
67
  signing_key:
68
68
  specification_version: 3
69
- summary: A Command-Line tool for scraping any user's original photos
69
+ summary: A Command-Line tool for scraping any user's original photos, or uploading all media in a given directory
70
70
  test_files: []
71
71