trustedsearch 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +4 -4
- data/lib/tasks/v1.rake +19 -2
- data/lib/trustedsearch/api.rb +11 -6
- data/lib/trustedsearch/api_resource.rb +2 -0
- data/lib/trustedsearch.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDEzY2RhNTY1Nzk0OWZhNDM2MzJmNjJiZTg4NzBkZTlkY2ZlZThkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDgwZDU2NjEzODgxNDIwNGNiMTdiM2JkN2I5MTgyY2NmYTE5YTg2ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODBmMmY2NTRhNWU2NTg3NDJiOWVlM2I3MGI4OGIxMTFjNTdhYzVjYWMyY2Qx
|
10
|
+
ZGFiYTM0ODZlOTIwOWVjZGIyM2YyZGZkNjI2MGZhZTEyZjgzMGQ2ZDcwMWIz
|
11
|
+
MTRiYWQzYmM3YmNiN2U0Y2FlMjlkMTFmY2Q1ODE5NjVjZTE1OTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTk2OWI5MTBlODkxMzkwODQyN2EwMDE2ODdiMWEzMWNmYTNiYWFjNDQ1ZWNj
|
14
|
+
ODQ5MWJhNGZhNGRlMzdkNmZkODM5ZmNlMGQwMWUwMTU1MjMzZWNmMzE3Mjg1
|
15
|
+
NjQ3ZjU1MzcwZjk3ZGQ3OWIwNDIzNWNmZDZmYTUxNzU0MDk1MDg=
|
data/README.md
CHANGED
@@ -66,12 +66,12 @@ api = TrustedSearch::V1.new
|
|
66
66
|
puts api.getBusinessUpdate(534f95e8-1de1-558f-885c-3962f22c9a28).data.to_s
|
67
67
|
```
|
68
68
|
|
69
|
-
#### Get Business Updates
|
69
|
+
#### Get Business Updates since epoch 1380611103
|
70
70
|
See the [API documentation](http://developers.trustedsearch.org/#/get-business-updates) for a list of parameters for each API resource.
|
71
71
|
|
72
72
|
```ruby
|
73
73
|
api = TrustedSearch::V1.new
|
74
|
-
puts api.
|
74
|
+
puts api.getBusinessUpdateSince(1380611103).data.to_s
|
75
75
|
```
|
76
76
|
|
77
77
|
#### Submit New Business Listings
|
@@ -202,9 +202,9 @@ Get update for location 534f95e8-1de1-558f-885c-3962f22c9a28
|
|
202
202
|
|
203
203
|
rake v1:updates[YourPublicKey,YourPrivateKey,534f95e8-1de1-558f-885c-3962f22c9a28]
|
204
204
|
|
205
|
-
Get update
|
205
|
+
Get update since 1380611103
|
206
206
|
|
207
|
-
rake v1:
|
207
|
+
rake v1:updates_since[YourPublicKey,YourPrivateKey,1380611103]
|
208
208
|
|
209
209
|
Submit a new location using JSON data in file relative path "examples/body.json"
|
210
210
|
|
data/lib/tasks/v1.rake
CHANGED
@@ -4,7 +4,7 @@ namespace :v1 do
|
|
4
4
|
end
|
5
5
|
|
6
6
|
desc "Get the directory listings updates. [uuid] if not specified, returns all."
|
7
|
-
task :updates, [:public_key, :private_key, :uuid
|
7
|
+
task :updates, [:public_key, :private_key, :uuid] do |t, args|
|
8
8
|
TrustedSearch.public_key = args.public_key
|
9
9
|
TrustedSearch.private_key = args.private_key
|
10
10
|
TrustedSearch.environment = ( ENV['env'] ? ENV['env'] : 'sandbox')
|
@@ -12,10 +12,27 @@ namespace :v1 do
|
|
12
12
|
if(uuid == "")
|
13
13
|
uuid = nil
|
14
14
|
end
|
15
|
+
api = TrustedSearch::V1.new
|
16
|
+
begin
|
17
|
+
puts api.getBusinessUpdate(uuid).data.to_s
|
18
|
+
rescue Exception => e
|
19
|
+
puts "Message: " + e.message
|
20
|
+
puts "Body:"
|
21
|
+
puts e.body
|
22
|
+
puts "Code: " + e.code.to_s
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Get the directory listings updates. from a given point in time."
|
28
|
+
task :updates_since, [:public_key, :private_key, :since] do |t, args|
|
29
|
+
TrustedSearch.public_key = args.public_key
|
30
|
+
TrustedSearch.private_key = args.private_key
|
31
|
+
TrustedSearch.environment = ( ENV['env'] ? ENV['env'] : 'sandbox')
|
15
32
|
since = ( args.since.nil? ? nil : args.since)
|
16
33
|
api = TrustedSearch::V1.new
|
17
34
|
begin
|
18
|
-
puts api.
|
35
|
+
puts api.getBusinessUpdateSince(since).data.to_s
|
19
36
|
rescue Exception => e
|
20
37
|
puts "Message: " + e.message
|
21
38
|
puts "Body:"
|
data/lib/trustedsearch/api.rb
CHANGED
@@ -15,18 +15,23 @@ module TrustedSearch
|
|
15
15
|
|
16
16
|
# Makes an API request to /directory-listings
|
17
17
|
# If uuid is nil, all are returned.
|
18
|
-
|
19
|
-
def getBusinessUpdate(uuid = nil , since = nil)
|
18
|
+
def getBusinessUpdate(uuid = nil)
|
20
19
|
|
21
20
|
method_url = 'directory-listings' + ( ( uuid ) ? "/#{uuid}" : '')
|
22
21
|
params = {}
|
23
|
-
if(since)
|
24
|
-
params[:since] = since
|
25
|
-
end
|
26
|
-
|
27
22
|
return self.get(method_url, params)
|
28
23
|
end
|
29
24
|
|
25
|
+
# Makes an API request to /directory-listings
|
26
|
+
# Since is an integer, only changes made since that time are returned.
|
27
|
+
def getBusinessUpdateSince( since )
|
28
|
+
|
29
|
+
method_url = 'directory-listings'
|
30
|
+
params = {}
|
31
|
+
params[:since] = since
|
32
|
+
return self.get(method_url, params)
|
33
|
+
end
|
34
|
+
|
30
35
|
#Submit a single business more multiple business for
|
31
36
|
def postBusiness( data = [] )
|
32
37
|
method_url = 'local-business'
|
@@ -110,6 +110,8 @@ module TrustedSearch
|
|
110
110
|
def end_point
|
111
111
|
if(TrustedSearch.environment == 'production')
|
112
112
|
return TrustedSearch.environments[:production][:domain]
|
113
|
+
elsif(TrustedSearch.environment == 'local')
|
114
|
+
return TrustedSearch.environments[:local][:domain]
|
113
115
|
else
|
114
116
|
return TrustedSearch.environments[:sandbox][:domain]
|
115
117
|
end
|
data/lib/trustedsearch.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trustedsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- trustedSEARCH Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|