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 +4 -4
- data/lib/outbrain/api.rb +1 -0
- data/lib/outbrain/api/token.rb +12 -0
- data/lib/outbrain/api/version.rb +1 -1
- data/lib/outbrain/request.rb +10 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a4a474d04b8871c59394f04718b90a1ddf9ebaa
|
4
|
+
data.tar.gz: 60e36aa9664723d3b05f9ab73fa91089c87c9df8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52cca96f856802d0d9e3b8751baaab3e29921ee402d84ea0918e1b9650a13da2fee6949dcb64802347ab60c3501657a402d8a78a5a3c17aaa3721d67422bf8c1
|
7
|
+
data.tar.gz: 7f345c0f84aca46be0464e9ec5df8c358d48ed816eeacb7af6c76508a59e5dad48c5e9d497b07e9e57fe7281638043b2050b9c362d702eef559cb40406d84f1e
|
data/lib/outbrain/api.rb
CHANGED
@@ -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'
|
data/lib/outbrain/api/version.rb
CHANGED
data/lib/outbrain/request.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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
|