timelapse 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/timelapse +10 -0
- data/lib/timelapse.rb +26 -1
- data/lib/timelapse/version.rb +1 -1
- data/timelapse.gemspec +2 -0
- metadata +55 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e737c8a7a455aabb7a5ce3660cd6e9bd71a6a663
|
4
|
+
data.tar.gz: eb46cb2da6762d13edb01872d106dc7fd7910ad5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5b1a939b2884a524326f7731cd55752d61d15742f33f5fb74856a1a54e956980576d46dd51692c4688a336a19fe6e35a15bc6cdf1c1e0c295fd589f6c5708317
|
7
|
+
data.tar.gz: f2657607024234ff7bd54b0908555c22ae2601016275f876ee4c95065df7a35a32239b3a1cdd47d66c0fc11628ffd02a6060df311162d8dabf3a5ecf56097475
|
data/bin/timelapse
CHANGED
@@ -11,10 +11,20 @@ opts = Slop.parse(:help => true) do
|
|
11
11
|
|
12
12
|
on 'output=', 'folder to store images in'
|
13
13
|
on 'interval=', 'interval ie 30s'
|
14
|
+
on 'ftp_server=', "server address for ftp"
|
15
|
+
on 'ftp_user=', "username for ftp (required if ftp_server specified)"
|
16
|
+
on 'ftp_password=', "password for ftp (required if ftp_server specified)"
|
17
|
+
on 'ftp_path=', "path to store files in, defaults to '/'"
|
18
|
+
on 's3_bucket=', "bucket name to store images in"
|
19
|
+
on 's3_access_key=', "S3 access key for uploading (required if s3_bucket specified)"
|
20
|
+
on 's3_secret_key=', "S3 secret key (required if bucket specified)"
|
21
|
+
on 'delete_after_upload'
|
14
22
|
|
15
23
|
on 'v', 'verbose', 'Display crawl information'
|
16
24
|
end
|
17
25
|
|
18
26
|
options = opts.to_hash.delete_if { |k, v| v.nil? || k == :url}
|
19
27
|
|
28
|
+
|
29
|
+
|
20
30
|
Timelapse::Session.new.start(options)
|
data/lib/timelapse.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#require "timelapse/version"
|
2
2
|
require 'rufus/scheduler'
|
3
3
|
require 'gphoto4ruby'
|
4
|
+
require 'aws/s3'
|
5
|
+
require 'net/ftp'
|
4
6
|
|
5
7
|
module Timelapse
|
6
8
|
class Session
|
@@ -18,7 +20,30 @@ module Timelapse
|
|
18
20
|
scheduler.every options[:interval] do
|
19
21
|
puts "Taking picture..."
|
20
22
|
camera.capture.save(save_options).delete
|
21
|
-
puts "Saved."
|
23
|
+
puts "Saved to disk."
|
24
|
+
filename = "LICENSE.txt"
|
25
|
+
puts options
|
26
|
+
if options[:s3_bucket]
|
27
|
+
s3 = AWS::S3::Base.establish_connection!(
|
28
|
+
:access_key_id => options[:s3_access_key],
|
29
|
+
:secret_access_key => options[:s3_secret_key]
|
30
|
+
)
|
31
|
+
AWS::S3::Bucket.create(options[:s3_bucket])
|
32
|
+
AWS::S3::S3Object.store(filename, open(filename), options[:s3_bucket])
|
33
|
+
|
34
|
+
puts "Uploaded to S3."
|
35
|
+
end
|
36
|
+
|
37
|
+
if options[:ftp_server]
|
38
|
+
ftp = Net::FTP.new(options[:ftp_server])
|
39
|
+
ftp.login(options[:ftp_user], options[:ftp_password])
|
40
|
+
puts ftp.pwd()
|
41
|
+
ftp.chdir(options[:ftp_path]) if options[:ftp_path]
|
42
|
+
ftp.storbinary('STOR', filename, open(filename))
|
43
|
+
ftp.close
|
44
|
+
puts "Uploaded to FTP."
|
45
|
+
end
|
46
|
+
|
22
47
|
end
|
23
48
|
scheduler.join
|
24
49
|
rescue => e
|
data/lib/timelapse/version.rb
CHANGED
data/timelapse.gemspec
CHANGED
metadata
CHANGED
@@ -1,71 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timelapse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Stewart McKee
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-31 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rake
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: gphoto4ruby
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: '0'
|
44
48
|
type: :runtime
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: rufus-scheduler
|
49
|
-
requirement:
|
50
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
type: :runtime
|
56
63
|
prerelease: false
|
57
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: slop
|
60
|
-
requirement:
|
61
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
62
72
|
requirements:
|
63
|
-
- -
|
73
|
+
- - '>='
|
64
74
|
- !ruby/object:Gem::Version
|
65
75
|
version: '0'
|
66
76
|
type: :runtime
|
67
77
|
prerelease: false
|
68
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: aws-s3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
description: Uses gphoto2 to interact with cameras to generate timelapses
|
70
98
|
email:
|
71
99
|
- stewart@theizone.co.uk
|
@@ -87,26 +115,25 @@ files:
|
|
87
115
|
homepage: ''
|
88
116
|
licenses:
|
89
117
|
- MIT
|
118
|
+
metadata: {}
|
90
119
|
post_install_message:
|
91
120
|
rdoc_options: []
|
92
121
|
require_paths:
|
93
122
|
- lib
|
94
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
124
|
requirements:
|
97
|
-
- -
|
125
|
+
- - '>='
|
98
126
|
- !ruby/object:Gem::Version
|
99
127
|
version: '0'
|
100
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
129
|
requirements:
|
103
|
-
- -
|
130
|
+
- - '>='
|
104
131
|
- !ruby/object:Gem::Version
|
105
132
|
version: '0'
|
106
133
|
requirements: []
|
107
134
|
rubyforge_project:
|
108
|
-
rubygems_version:
|
135
|
+
rubygems_version: 2.0.3
|
109
136
|
signing_key:
|
110
|
-
specification_version:
|
137
|
+
specification_version: 4
|
111
138
|
summary: Uses gphoto2 to interact with cameras to generate timelapses
|
112
139
|
test_files: []
|