live_paper 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 +4 -4
- data/README.md +2 -0
- data/lib/live_paper/version.rb +1 -1
- data/lib/live_paper.rb +3 -21
- data/live_paper.gemspec +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 094d1ab2992698b7f3c00d0243817276e88a5dbe
|
4
|
+
data.tar.gz: b60bc9c6f736b8430dc006e382c160e13c1ad6e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0a65ccbc4b3db5190d7e91b09d446c8923eff5e8414d83652245238d84b992e81199c076ce02d32c4161cca18077afbd02010d2edbf7cff533ff325f0b64ce
|
7
|
+
data.tar.gz: f24d967a52723f79bb539b7c0ca064850a827db911f1d05a0abef23e8bc96de9bde3a039c0a218bdccec3f6bd4c56abbc69f33f766806c73be73b1b80784d13b
|
data/README.md
CHANGED
data/lib/live_paper/version.rb
CHANGED
data/lib/live_paper.rb
CHANGED
@@ -34,13 +34,8 @@ module LivePaper
|
|
34
34
|
def shorten(dest)
|
35
35
|
#returns shortened url
|
36
36
|
trig = trigger "shorturl"
|
37
|
-
puts "Trigger: #{trig}"
|
38
|
-
|
39
37
|
payoff = url_payoff dest
|
40
|
-
|
41
|
-
|
42
|
-
l = link(trig, payoff)
|
43
|
-
puts "Link: #{l}"
|
38
|
+
link(trig, payoff)
|
44
39
|
|
45
40
|
trig["link"].select { |item| item["rel"] == "shortURL" }.first["href"]
|
46
41
|
end
|
@@ -48,32 +43,20 @@ module LivePaper
|
|
48
43
|
def qr_bytes(dest)
|
49
44
|
#returns shortened url
|
50
45
|
trig = trigger "qrcode"
|
51
|
-
puts "Trigger: #{trig}"
|
52
|
-
|
53
46
|
payoff = url_payoff dest
|
54
|
-
|
55
|
-
|
56
|
-
l = link(trig, payoff)
|
57
|
-
puts "Link: #{l}"
|
47
|
+
link(trig, payoff)
|
58
48
|
|
59
49
|
img_loc = trig["link"].select { |item| item["rel"] == "image" }.first["href"]
|
60
|
-
|
61
50
|
resp = RestClient.get(img_loc, {Authorization: api_headers[:Authorization], Accept: 'image/png'})
|
62
51
|
resp.body
|
63
52
|
end
|
64
53
|
|
65
54
|
def watermark_bytes(dest, image_url)
|
66
55
|
image = upload_image image_url
|
67
|
-
puts "Source Image: #{image}"
|
68
56
|
|
69
57
|
trig = trigger "watermark", watermark: {imageURL: image, resolution: "75", strength: "10"}
|
70
|
-
puts "\nTrigger: #{trig}"
|
71
|
-
|
72
58
|
payoff = url_payoff dest
|
73
|
-
|
74
|
-
|
75
|
-
l = link(trig, payoff)
|
76
|
-
puts "\nLink: #{l}"
|
59
|
+
link(trig, payoff)
|
77
60
|
|
78
61
|
img_loc = trig["link"].select { |item| item["rel"] == "image" }.first["href"]
|
79
62
|
resp = RestClient.get(img_loc, Authorization: api_headers[:Authorization])
|
@@ -85,7 +68,6 @@ module LivePaper
|
|
85
68
|
|
86
69
|
private
|
87
70
|
def upload_image(img)
|
88
|
-
puts "Upload Image #{img}"
|
89
71
|
uri='https://storage.livepaperapi.com/objects/files'
|
90
72
|
# return the original img uri if it is LPP storage
|
91
73
|
if img.include? uri
|
data/live_paper.gemspec
CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.add_runtime_dependency "rest-client"
|
22
|
+
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
23
24
|
spec.add_development_dependency "rake"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: live_paper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Whitmarsh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
|
-
type: :
|
21
|
+
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|