bazaar_voice 0.1.1 → 0.1.4
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.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/bazaar_voice.rb +14 -0
- data/lib/bazaar_voice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 351d52c9242cda1687a216135e38d9a449431bf5
|
|
4
|
+
data.tar.gz: 4d6b21b18a4c7eef02f989ca7fe58f1f05995329
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f886c62c2d09d4eb2f203638dafb5dfb5303a43feb34dab01b6bdd041f08dd1900efa76e74de50dd4e4710eac39cbc5cb1981c400bef6a8b93e1559d268354ee
|
|
7
|
+
data.tar.gz: d2fdd5cb6ff603d9a7ef2366898a99c9b4eca922b2eb5131443d3cd7e8ffadd155948b6874427ea30e1e55b1f2bfe85b4751572a519872fb0fc290ee882b550c
|
data/README.md
CHANGED
|
@@ -27,6 +27,10 @@ BizaarVoice::Api.configure do |c|
|
|
|
27
27
|
c.format = 'whatever' # defautls to 'json'
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# was_helpful / Feedback / Vote
|
|
31
|
+
BazaarVoice::Api.was_helpful(true, 123)
|
|
32
|
+
# POST | https://#{host}/data/submitfeedback.json?passkey=#{passkey}&apiversion=#{version}&ContentType=review&FeedbackType=helpfulness&Vote=Positive&ContentId=123
|
|
33
|
+
|
|
30
34
|
# get all reviews
|
|
31
35
|
BizaarVoice::Api.get_reviews({'Limit' => 2, 'Filter' => 'ProductId:O-006-2034-R'})
|
|
32
36
|
|
|
@@ -52,3 +56,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
|
52
56
|
|
|
53
57
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
54
58
|
|
|
59
|
+
|
data/lib/bazaar_voice.rb
CHANGED
|
@@ -25,6 +25,16 @@ module BazaarVoice
|
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
def was_helpful(boolean, content_id)
|
|
29
|
+
post(
|
|
30
|
+
'submitfeedback',
|
|
31
|
+
'ContentType' => 'review',
|
|
32
|
+
'FeedbackType' => 'helpfulness',
|
|
33
|
+
'Vote' => (boolean ? 'Positive' : 'Negative'),
|
|
34
|
+
'ContentId' => content_id
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
28
38
|
private
|
|
29
39
|
|
|
30
40
|
def rest_client
|
|
@@ -40,6 +50,10 @@ module BazaarVoice
|
|
|
40
50
|
JSON.parse rest_client.get(uri(resource, params))
|
|
41
51
|
end
|
|
42
52
|
|
|
53
|
+
def post(resource, params = nil)
|
|
54
|
+
JSON.parse rest_client.post(uri(resource, params), nil)
|
|
55
|
+
end
|
|
56
|
+
|
|
43
57
|
def uri(resource, params = nil)
|
|
44
58
|
"#{configuration.protocol}://#{configuration.host}/data/#{resource}.#{configuration.format}#{query_string(params)}"
|
|
45
59
|
end
|
data/lib/bazaar_voice/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bazaar_voice
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dean Shelton
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-09-
|
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|