jekyll-amazon 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.travis.yml +4 -0
- data/Rakefile +4 -0
- data/lib/jekyll-amazon/amazon_tag.rb +25 -16
- data/lib/jekyll-amazon/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c962cc8ef8e8ac44d9eb1c776b34f558b1d0ceae
|
4
|
+
data.tar.gz: 17752eb9437ac70c3cf2c980e48bf28a0f6c5162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795069dc05db49cb586084461b2df334df1fe3de749e6b99aebac4465b2f7a913bba5540a191e3f886ff1e6ced624ac5efdb6c4eb3bac7afc4b3097f0b296ec5
|
7
|
+
data.tar.gz: ce5b15b49491eed261950faa98f7432a0d1bf7a638bc361e39594088baa81311fc067c3cdb3233734681b9cc876393200b367c8c16ed1eb7f8ab25dd6cdc8e59
|
data/.rspec
CHANGED
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -11,6 +11,7 @@ module Jekyll
|
|
11
11
|
|
12
12
|
ITEM_HASH = {
|
13
13
|
asin: 'ASIN',
|
14
|
+
salesrank: 'SalesRank',
|
14
15
|
title: 'ItemAttributes/Title',
|
15
16
|
author: 'ItemAttributes/Author',
|
16
17
|
publisher: 'ItemAttributes/Manufacturer',
|
@@ -42,7 +43,7 @@ module Jekyll
|
|
42
43
|
options[:associate_tag] = ECS_ASSOCIATE_TAG
|
43
44
|
options[:AWS_access_key_id] = AWS_ACCESS_KEY_ID
|
44
45
|
options[:AWS_secret_key] = AWS_SECRET_KEY
|
45
|
-
options[:response_group] = 'Images,ItemAttributes'
|
46
|
+
options[:response_group] = 'SalesRank,Images,ItemAttributes'
|
46
47
|
options[:country] = ENV['ECS_COUNTRY'] || 'jp'
|
47
48
|
end
|
48
49
|
end
|
@@ -138,33 +139,41 @@ module Jekyll
|
|
138
139
|
end
|
139
140
|
|
140
141
|
def detail(item)
|
141
|
-
url = item[:detail_page_url]
|
142
|
-
image_url = item[:medium_image_url]
|
143
|
-
title = item[:title]
|
144
142
|
author = item[:author]
|
145
143
|
publisher = item[:publisher]
|
146
144
|
date = item[:publication_date] || item[:release_date]
|
145
|
+
salesrank = item[:salesrank]
|
147
146
|
str = <<-"EOS"
|
148
|
-
<div class="
|
149
|
-
<div class="
|
150
|
-
|
151
|
-
<img src="#{image_url}" alt="#{title}" />
|
152
|
-
</a>
|
147
|
+
<div class="jk-amazon-item">
|
148
|
+
<div class="jk-amazon-image">
|
149
|
+
#{image(item)}
|
153
150
|
</div>
|
154
|
-
<div class="
|
155
|
-
<div class="
|
156
|
-
|
151
|
+
<div class="jk-amazon-info">
|
152
|
+
<div class="jk-amazon-info-title">
|
153
|
+
#{title(item)}
|
154
|
+
</div>
|
155
|
+
<div class="jk-amazon-info-author">
|
156
|
+
#{labeled("Author: ", author)}
|
157
157
|
</div>
|
158
|
-
<div class="
|
159
|
-
|
160
|
-
|
161
|
-
|
158
|
+
<div class="jk-amazon-info-publisher">
|
159
|
+
#{labeled("Publisher: ", publisher)}
|
160
|
+
</div>
|
161
|
+
<div class="jk-amazon-info-date">
|
162
|
+
#{labeled("Date: ", date)}
|
163
|
+
</div>
|
164
|
+
<div class="jk-amazon-info-salesrank">
|
165
|
+
#{labeled("Sales Rank: ", salesrank)}
|
162
166
|
</div>
|
163
167
|
</div>
|
164
168
|
</div>
|
165
169
|
EOS
|
166
170
|
str.to_s
|
167
171
|
end
|
172
|
+
|
173
|
+
def labeled(label, value)
|
174
|
+
return "" if value.nil? || value.empty?
|
175
|
+
"<span class=\"amazon-info-label\">#{label} </span>#{value}"
|
176
|
+
end
|
168
177
|
end
|
169
178
|
end
|
170
179
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-amazon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tokzk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazon-ecs
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".rspec"
|
92
|
+
- ".travis.yml"
|
92
93
|
- Gemfile
|
93
94
|
- README.md
|
94
95
|
- Rakefile
|