tamber 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af8fed11bb5f401f45c1c884abfaca26fb830959
4
- data.tar.gz: e623a12f3d1b68e53c8813ab18b9007f141dd4e2
3
+ metadata.gz: 92bb07bf50bc996017ca5884653966e63bd24f6e
4
+ data.tar.gz: 7365b9bfdd9540d240fb52d9f44498d7f2152342
5
5
  SHA512:
6
- metadata.gz: 887b3119d229994872f2686c20f0622e4b683ea25d829a79d8773b24a276f043ff04031030d7a3f58637f73ff63b611c561987783fbca5d8e7f48f77c7030232
7
- data.tar.gz: 38428805fbce8ccdde489cd7d95c80dd2145d7d8b333b3f0657598913f9b6761e76a62f710646ffe53414c43eab2ccdce42c137ab9fa39a5ba82774f72fcb138
6
+ metadata.gz: b89256c171c11ae98f0970f1ac53f9d6fc7090c1ea5292c191bd0dc5c85254faa0f86f62863338749720fddcbd8598e322c46bbda0bed191bbbdcf69c5f8f58a
7
+ data.tar.gz: 5a430454fa735e98fd323adbc6940fe58f97e793b0c84b07c14326d2273120b118f9e038b012e6d3397e8c9893c60ffe96422f903c85e5262ee23e1ecbb0780d
data/README.md CHANGED
@@ -64,7 +64,7 @@ The primary method of discovery in Tamber is the `Discover.next` method, which r
64
64
 
65
65
  #### For You
66
66
 
67
- To put personalized recommendations on your homepage, or in any recommended section, just call `Discover.next` with the number of recommendations you want to display (if you are calling server-side, also set the `user`).
67
+ To put personalized recommendations on your homepage, or in any recommended section, just call `Discover.next` with the given user's id and the number of recommendations you want to display.
68
68
 
69
69
  ```rb
70
70
  Tamber.project_key = 'your_project_key'
@@ -80,20 +80,16 @@ rescue TamberError => error
80
80
  end
81
81
  ```
82
82
 
83
- ##### `continuation`
84
-
85
- `Discover.next` is optimized for the exact moment and context of the user at the time of request, so standard pagination is not possible. Instead, `Discover.next` uses automatic continuation to allow you to 'show more' or implement infinite scrolling.
83
+ #### Up Next
86
84
 
87
- When you want to add more recommendations to those currently displayed to the user, just set the `continuation` field to `true`. Tamber will automatically generate the set of items that should be appended to the current user-session's list. The `Discover.next` user-session is reset when `Discover.next` is called without `continuation`.
85
+ Keep users engaged by creating a path of discovery as they navigate from item to item, always showing the right mix of items they should check out next. Just add the id of the item that the user is navigating to / looking at.
88
86
 
89
87
  ```rb
90
- Tamber.project_key = 'your_project_key'
91
-
92
88
  begin
93
89
  d = Tamber::Discover.next(
94
90
  user: 'user_rlox8k927z7p',
95
- number: 10,
96
- continuation: true
91
+ item: 'item_wmt4fn6o4zlk',
92
+ number: 14
97
93
  )
98
94
  d.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"}
99
95
  rescue TamberError => error
@@ -101,16 +97,21 @@ rescue TamberError => error
101
97
  end
102
98
  ```
103
99
 
104
- #### Up Next
105
100
 
106
- Keep users engaged by creating a path of discovery as they navigate from item to item. Just add the id of the item that the user is navigating to / looking at.
101
+ ##### `continuation`
102
+
103
+ `Discover.next` is optimized for the exact moment and context of the user at the time of request, so standard pagination is not possible. Instead, `Discover.next` uses automatic continuation to allow you to 'show more' or implement infinite scrolling.
104
+
105
+ When you want to add more recommendations to those currently displayed to the user, just set the `continuation` field to `true`. Tamber will automatically generate the set of items that should be appended to the current user-session's list. The `Discover.next` user-session is reset when `Discover.next` is called without `continuation`.
107
106
 
108
107
  ```rb
108
+ Tamber.project_key = 'your_project_key'
109
+
109
110
  begin
110
111
  d = Tamber::Discover.next(
111
112
  user: 'user_rlox8k927z7p',
112
- item: 'item_wmt4fn6o4zlk',
113
- number: 14
113
+ number: 10,
114
+ continuation: true
114
115
  )
115
116
  d.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"}
116
117
  rescue TamberError => error
@@ -118,23 +119,6 @@ rescue TamberError => error
118
119
  end
119
120
  ```
120
121
 
121
- If you are tracking events in your backend and want to track `clicked` or `viewed` events when users request the next page, you can also get `next` for the user-item pair by adding the `get_recs` field to your `Event.track` call.
122
-
123
- ```rb
124
- begin
125
- e = Tamber::Event.track(
126
- user: 'user_rlox8k927z7p',
127
- behavior: 'clicked'
128
- item: 'item_wmt4fn6o4zlk',
129
- get_recs: {
130
- number: 14
131
- }
132
- )
133
- e.recommended.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"}
134
- rescue TamberError => error
135
- puts error.message
136
- end
137
- ```
138
122
 
139
123
  #### Trending
140
124
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -16,6 +16,7 @@ require 'tamber/api_operations/create'
16
16
  require 'tamber/api_operations/update'
17
17
  require 'tamber/api_operations/remove'
18
18
  require 'tamber/api_operations/retrieve'
19
+ require 'tamber/api_operations/list'
19
20
  require 'tamber/api_operations/request'
20
21
 
21
22
  require 'tamber/tamber_object'
@@ -3,6 +3,7 @@ module Tamber
3
3
  extend Tamber::APIOperations::Create
4
4
  extend Tamber::APIOperations::Update
5
5
  extend Tamber::APIOperations::Retrieve
6
+ extend Tamber::APIOperations::List
6
7
 
7
8
  # hide an item from all Discover results
8
9
  def self.hide(params={})
@@ -3,6 +3,7 @@ module Tamber
3
3
  extend Tamber::APIOperations::Create
4
4
  extend Tamber::APIOperations::Update
5
5
  extend Tamber::APIOperations::Retrieve
6
+ extend Tamber::APIOperations::List
6
7
 
7
8
  def self.search(params={})
8
9
  response = request(:post, url + '/search', params)
@@ -1,3 +1,3 @@
1
1
  module Tamber
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency('rest-client', '~> 1.4')
17
17
  s.add_dependency('json', '~> 1.8.1')
18
- s.add_dependency('activesupport', '~> 4.2.4')
18
+ s.add_dependency('activesupport', '>= 4.2.4')
19
19
 
20
20
  s.add_development_dependency('mocha', '~> 0.13.2')
21
21
  s.add_development_dependency('shoulda', '~> 3.4.0')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tamber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexi Robbins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-14 00:00:00.000000000 Z
12
+ date: 2017-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -43,14 +43,14 @@ dependencies:
43
43
  name: activesupport
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: 4.2.4
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: 4.2.4
56
56
  - !ruby/object:Gem::Dependency