vendasta-ri 0.0.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 +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +36 -0
- data/Rakefile +2 -0
- data/lib/vendasta/ri.rb +197 -0
- data/lib/vendasta/ri/version.rb +5 -0
- data/vendasta-ri.gemspec +24 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 78e8d0a44c2c55e9c1961ba1debd25df0eb060ff
|
4
|
+
data.tar.gz: 12697bc48963db1d5ff858021c0043296ca96207
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a4a58e919db7af815bc23cda89f3c96a8ee54a9a9012f82edbbd36191401e79a98d0cc26e593ed420a5d918959edf5d122e762544d5675128d4f31417a4c2c59
|
7
|
+
data.tar.gz: 831d4bc362e7b591efedeb92da001ae773b0e401eb4a22ab1ae7159fe52fb97e349864ffaa9921089363179567820b41899144363535830c65d269ef5be1491f
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Dan Vera
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Vendasta::Ri
|
2
|
+
|
3
|
+
API wrapper for Reputation Intelligence
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'vendasta-ri'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install vendasta-ri
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
Create an initializer (vendasta.rb)
|
22
|
+
|
23
|
+
ENV["VENDASTA_RI_APIUSER"] = "apiUser"
|
24
|
+
ENV["VENDASTA_RI_APIKEY"] = "apiKey"
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
TODO: Write usage instructions here
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
1. Fork it ( https://github.com/drkyro/vendasta-ri/fork )
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
36
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/lib/vendasta/ri.rb
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
require "vendasta/ri/version"
|
2
|
+
require "httparty"
|
3
|
+
|
4
|
+
module Vendasta
|
5
|
+
|
6
|
+
OPTIONS = {
|
7
|
+
:endpoint => 'https://reputation-intelligence-api.vendasta.com/api/v2'
|
8
|
+
}
|
9
|
+
|
10
|
+
module RI
|
11
|
+
|
12
|
+
include HTTParty
|
13
|
+
|
14
|
+
## Accounts
|
15
|
+
module Accounts
|
16
|
+
|
17
|
+
def self.ipsum
|
18
|
+
puts "hi"
|
19
|
+
puts ENV["VENDASTA_RI_APIUSER"]
|
20
|
+
puts ENV["VENDASTA_RI_APIKEY"]
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.lookupAccounts # Lookup Accounts
|
24
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/account/lookup/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"]})
|
25
|
+
|
26
|
+
if response.success?
|
27
|
+
response = JSON.parse(response.body)
|
28
|
+
else
|
29
|
+
response = JSON.parse(response.body)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.getAccount(customerIdentifier) # Get Accounts by ID
|
34
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/account/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
35
|
+
|
36
|
+
if response.success?
|
37
|
+
response = JSON.parse(response.body)
|
38
|
+
else
|
39
|
+
response = JSON.parse(response.body)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
## Visibility
|
46
|
+
module Visibility
|
47
|
+
|
48
|
+
def self.lookupListings(customerIdentifier) # Lookup Listings
|
49
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
50
|
+
|
51
|
+
if response.success?
|
52
|
+
response = JSON.parse(response.body)
|
53
|
+
else
|
54
|
+
response = JSON.parse(response.body)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.lookupPossibleListings(customerIdentifier) # Lookup Possible Listings
|
59
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupPossibleListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
60
|
+
|
61
|
+
if response.success?
|
62
|
+
response = JSON.parse(response.body)
|
63
|
+
else
|
64
|
+
response = JSON.parse(response.body)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.getVisibilityStats(customerIdentifier) # Get Visibility Stats
|
69
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/getStats/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
70
|
+
|
71
|
+
if response.success?
|
72
|
+
response = JSON.parse(response.body)
|
73
|
+
else
|
74
|
+
response = JSON.parse(response.body)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
## Reviews
|
81
|
+
module Reviews
|
82
|
+
|
83
|
+
def self.getReview(customerIdentifier, reviewId) # Get Reviews by ID
|
84
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/review/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier, :reviewId => reviewId})
|
85
|
+
|
86
|
+
if response.success?
|
87
|
+
response = JSON.parse(response.body)
|
88
|
+
else
|
89
|
+
response = JSON.parse(response.body)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.searchReviews(customerIdentifier) # Search Reviews
|
94
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/review/search/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
95
|
+
|
96
|
+
if response.success?
|
97
|
+
response = JSON.parse(response.body)
|
98
|
+
else
|
99
|
+
response = JSON.parse(response.body)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.searchReviews(customerIdentifier) # Search Reviews
|
104
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/review/search/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
105
|
+
|
106
|
+
if response.success?
|
107
|
+
response = JSON.parse(response.body)
|
108
|
+
else
|
109
|
+
response = JSON.parse(response.body)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.getReviewStatistics(customerIdentifier) # Get Review Statistics
|
114
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/review/getStats/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
115
|
+
|
116
|
+
if response.success?
|
117
|
+
response = JSON.parse(response.body)
|
118
|
+
else
|
119
|
+
response = JSON.parse(response.body)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
## Mentions
|
126
|
+
module Mentions
|
127
|
+
|
128
|
+
def self.searchMentions(customerIdentifier) # Search Mentions
|
129
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/mention/search/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
130
|
+
|
131
|
+
if response.success?
|
132
|
+
response = JSON.parse(response.body)
|
133
|
+
else
|
134
|
+
response = JSON.parse(response.body)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.getMention(customerIdentifier, mentionId) # Get Mentions by ID
|
139
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/mention/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier, :mentionId => mentionId})
|
140
|
+
|
141
|
+
if response.success?
|
142
|
+
response = JSON.parse(response.body)
|
143
|
+
else
|
144
|
+
response = JSON.parse(response.body)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
## Social
|
151
|
+
module Social
|
152
|
+
|
153
|
+
def self.getSocialStats(customerIdentifier) # Get Social Stats
|
154
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/social/getStats/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
155
|
+
|
156
|
+
if response.success?
|
157
|
+
response = JSON.parse(response.body)
|
158
|
+
else
|
159
|
+
response = JSON.parse(response.body)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
end
|
164
|
+
|
165
|
+
## Markets
|
166
|
+
module Markets
|
167
|
+
|
168
|
+
def self.lookupMarkets # Lookup Markets
|
169
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/market/lookup/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"]})
|
170
|
+
|
171
|
+
if response.success?
|
172
|
+
response = JSON.parse(response.body)
|
173
|
+
else
|
174
|
+
response = JSON.parse(response.body)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
## Competition
|
181
|
+
module Competition
|
182
|
+
|
183
|
+
def self.lookupShareOfVoice(customerIdentifier) # Lookup Share of Voice
|
184
|
+
response = HTTParty.get("#{OPTIONS[:endpoint]}/competition/lookupShareOfVoice/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})
|
185
|
+
|
186
|
+
if response.success?
|
187
|
+
response = JSON.parse(response.body)
|
188
|
+
else
|
189
|
+
response = JSON.parse(response.body)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
data/vendasta-ri.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vendasta/ri/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vendasta-ri"
|
8
|
+
spec.version = Vendasta::Ri::VERSION
|
9
|
+
spec.authors = ["Dan Vera"]
|
10
|
+
spec.email = ["dan@yovu.co"]
|
11
|
+
spec.summary = %q{Vendasta - Reputation Intelligence}
|
12
|
+
spec.description = %q{Vendasta - Reputation Intelligence}
|
13
|
+
spec.homepage = "https://github.com/drkyro/vendasta-ri"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_dependency "httparty"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vendasta-ri
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dan Vera
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Vendasta - Reputation Intelligence
|
56
|
+
email:
|
57
|
+
- dan@yovu.co
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/vendasta/ri.rb
|
68
|
+
- lib/vendasta/ri/version.rb
|
69
|
+
- vendasta-ri.gemspec
|
70
|
+
homepage: https://github.com/drkyro/vendasta-ri
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.2.2
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Vendasta - Reputation Intelligence
|
94
|
+
test_files: []
|