outbrain-api 0.2.9 → 0.2.10

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 731caa553b1bf4a04436ed039b6ab1e7b30d0354
4
- data.tar.gz: 76a3322202a6a1b9220af3e87d8f5a647a402b66
3
+ metadata.gz: 7a4a474d04b8871c59394f04718b90a1ddf9ebaa
4
+ data.tar.gz: 60e36aa9664723d3b05f9ab73fa91089c87c9df8
5
5
  SHA512:
6
- metadata.gz: 3322979826385136336f596028ebc4c0313cc5d8da93c400fb89760517aad057e740d583033f24bc329039c51f6d2acf04107bdfea96e6247ae1927e5bfaf454
7
- data.tar.gz: 87755c8c9b86a3eabe9c094fd3a95e47c903216fd38fc23f21ea92a15bb55b290fb83568d3eae6f3a5d47628773de82873ff4fc6e3d3d65d9ed48bfc098dff4b
6
+ metadata.gz: 52cca96f856802d0d9e3b8751baaab3e29921ee402d84ea0918e1b9650a13da2fee6949dcb64802347ab60c3501657a402d8a78a5a3c17aaa3721d67422bf8c1
7
+ data.tar.gz: 7f345c0f84aca46be0464e9ec5df8c358d48ed816eeacb7af6c76508a59e5dad48c5e9d497b07e9e57fe7281638043b2050b9c362d702eef559cb40406d84f1e
@@ -17,6 +17,7 @@ require "outbrain/api/campaign_by_day_report"
17
17
  require "outbrain/api/promoted_link_performance_report"
18
18
  require "outbrain/api/promoted_link"
19
19
  require "outbrain/api/geo_location"
20
+ require "outbrain/api/token"
20
21
 
21
22
  module Outbrain
22
23
  HEADER_AUTH_KEY = 'OB-TOKEN-V1'
@@ -0,0 +1,12 @@
1
+ module Outbrain
2
+ module Api
3
+ class Token < Base
4
+ PATH = "login"
5
+
6
+ def self.fetch(user_name, user_password)
7
+ credentials = {user_name: user_name, user_password: user_password}
8
+ token = Request.get(PATH, credentials)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Outbrain
2
2
  module Api
3
- VERSION = "0.2.9"
3
+ VERSION = "0.2.10"
4
4
  end
5
5
  end
@@ -17,6 +17,16 @@ module Outbrain
17
17
  where(resource, {}, options)
18
18
  end
19
19
 
20
+ #token retrieval
21
+ def self.get(resource, attributes)
22
+ user_name = attributes["user_name"] || attributes[:user_name]
23
+ user_password = attributes["user_password"] || attributes[:user_password]
24
+ api.basic_auth user_name, user_password
25
+
26
+ response = api.get(resource)
27
+ json_body = JSON.parse(response.body)
28
+ end
29
+
20
30
  def self.find(resource_path, id, options={})
21
31
  response = api.get("#{resource_path}/#{id}")
22
32
  json_body = JSON.parse(response.body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outbrain-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Blanchet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-02 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -125,6 +125,7 @@ files:
125
125
  - lib/outbrain/api/publisher_report.rb
126
126
  - lib/outbrain/api/relation.rb
127
127
  - lib/outbrain/api/report.rb
128
+ - lib/outbrain/api/token.rb
128
129
  - lib/outbrain/api/version.rb
129
130
  - lib/outbrain/base.rb
130
131
  - lib/outbrain/config.rb
@@ -151,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
152
  version: '0'
152
153
  requirements: []
153
154
  rubyforge_project:
154
- rubygems_version: 2.4.8
155
+ rubygems_version: 2.6.10
155
156
  signing_key:
156
157
  specification_version: 4
157
158
  summary: A simple wrapper for the outbrain api