trustedsearch 1.0.7 → 1.0.8

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTBjMTEzZmMyMzBhNzMwZjc4YmVhNTQyYTMyZjQ2NTQ5MmIzNDVmMQ==
4
+ MDEzY2RhNTY1Nzk0OWZhNDM2MzJmNjJiZTg4NzBkZTlkY2ZlZThkNw==
5
5
  data.tar.gz: !binary |-
6
- YWZhZGM3ZWI5MzdmMjhlMWQ0YjI1ZGY1NzRmYmI2ZTM0MDIxYTY5OA==
6
+ NDgwZDU2NjEzODgxNDIwNGNiMTdiM2JkN2I5MTgyY2NmYTE5YTg2ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmFhOGU1MmM4YjZkZTEwOGQ1OGE4NDU5OWJjNzRjNDk3ZWNlZmFiYjI3Y2E1
10
- Yjc4NTQ5YzljMzlkYWFlZTEwMmQ4NGMyNDlhOWJhYTc5ZGYwOWRlODY0YzQ0
11
- ZTE1N2Q1ZmUxZjEzMTIzNTRmYzU4NDJjZDc2NmQ5YWJmNThlYWU=
9
+ ODBmMmY2NTRhNWU2NTg3NDJiOWVlM2I3MGI4OGIxMTFjNTdhYzVjYWMyY2Qx
10
+ ZGFiYTM0ODZlOTIwOWVjZGIyM2YyZGZkNjI2MGZhZTEyZjgzMGQ2ZDcwMWIz
11
+ MTRiYWQzYmM3YmNiN2U0Y2FlMjlkMTFmY2Q1ODE5NjVjZTE1OTY=
12
12
  data.tar.gz: !binary |-
13
- ZWQwYTY3YjI4MWUxNzFmZGE2ZjhlNDVhMzIxYmU5MmM3YmZiOTIwOTk4ODU5
14
- YThhMGMwNTJjYzBkYTg2MjJmNjU0OGFhYjhmZTY1OTNmNzM1N2U4MzIxODAz
15
- ODJmNTViOTA1NTdjNmRmNTdiMzM3MTBmM2MxNjMwM2Y1ZTdlNTU=
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 for single location since epoch 1380611103
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.getBusinessUpdate( 534f95e8-1de1-558f-885c-3962f22c9a28, 1380611103).data.to_s
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 for location 534f95e8-1de1-558f-885c-3962f22c9a28 since 1380611103
205
+ Get update since 1380611103
206
206
 
207
- rake v1:updates[YourPublicKey,YourPrivateKey,534f95e8-1de1-558f-885c-3962f22c9a28,1380611103]
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, :since] do |t, args|
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.getBusinessUpdate(uuid, since).data.to_s
35
+ puts api.getBusinessUpdateSince(since).data.to_s
19
36
  rescue Exception => e
20
37
  puts "Message: " + e.message
21
38
  puts "Body:"
@@ -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
- # If since is provided as an integer, only changes made since that time are returned.
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
@@ -28,6 +28,9 @@ module TrustedSearch
28
28
  },
29
29
  :production => {
30
30
  :domain => 'https://api.trustedsearch.org'
31
+ },
32
+ :local => {
33
+ :domain => 'http://api.local.trustedsearch.org'
31
34
  }
32
35
  }
33
36
 
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.7
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-26 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable