snapcat 0.0.4 → 0.0.5
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/README.md +9 -1
- data/lib/snapcat/client.rb +11 -7
- data/snapcat.gemspec +1 -1
- data/spec/snapcat/client_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f2cfaf1b082d45d7eee9dc9ba54952ae1b398a5
|
4
|
+
data.tar.gz: 72cf2dbebb6b2c327eba9ac54848b588e5b5dd81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 088b65cf956ef42d22587b6450e5939d08c5b7d7e9bb880db640953f69d81fc01bfc3befa26bad0f35e0981e8e59126aeacf3a52de30897329665d75e52b301d
|
7
|
+
data.tar.gz: 151f723cda3ca65ae9ec9f9c2325ddec7859dc487bd87aff3978db4b5e0d671419f509e9bb65a96561ae2606959038aa1fc168ac0d974881480e2e6e1f2a8b9d
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Installation
|
|
13
13
|
|
14
14
|
Add this line to your application's `Gemfile`:
|
15
15
|
|
16
|
-
gem 'snapcat', '0.0.
|
16
|
+
gem 'snapcat', '0.0.5'
|
17
17
|
|
18
18
|
And then execute:
|
19
19
|
|
@@ -144,6 +144,14 @@ snap = user.snaps_received.first
|
|
144
144
|
media_response = snapcat.media_for(snap.id)
|
145
145
|
media = media_response.data[:media]
|
146
146
|
|
147
|
+
# Record a view
|
148
|
+
snapcat.view(snap.id)
|
149
|
+
|
150
|
+
# Record a screenshot
|
151
|
+
snapcat.screenshot(snap.id)
|
152
|
+
|
153
|
+
# Record a screenshot
|
154
|
+
|
147
155
|
# Learn more about the media
|
148
156
|
media.image?
|
149
157
|
media.video?
|
data/lib/snapcat/client.rb
CHANGED
@@ -85,11 +85,9 @@ module Snapcat
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def screenshot(snap_id, view_duration = 1)
|
88
|
-
raise NotImplementedError
|
89
|
-
|
90
88
|
snap_data = {
|
91
89
|
snap_id => {
|
92
|
-
c: Status::SCREENSHOT,
|
90
|
+
c: Snap::Status::SCREENSHOT,
|
93
91
|
sv: view_duration,
|
94
92
|
t: Timestamp.float
|
95
93
|
}
|
@@ -102,7 +100,11 @@ module Snapcat
|
|
102
100
|
}
|
103
101
|
]
|
104
102
|
|
105
|
-
|
103
|
+
@requestor.request_with_username(
|
104
|
+
'update_snaps',
|
105
|
+
events: events.to_json,
|
106
|
+
json: snap_data.to_json
|
107
|
+
)
|
106
108
|
end
|
107
109
|
|
108
110
|
def send_media(data, recipients, options = {})
|
@@ -131,8 +133,6 @@ module Snapcat
|
|
131
133
|
end
|
132
134
|
|
133
135
|
def view(snap_id, view_duration = 1)
|
134
|
-
raise NotImplementedError
|
135
|
-
|
136
136
|
snap_data = {
|
137
137
|
snap_id => { t: Timestamp.float, sv: view_duration }
|
138
138
|
}
|
@@ -149,7 +149,11 @@ module Snapcat
|
|
149
149
|
}
|
150
150
|
]
|
151
151
|
|
152
|
-
|
152
|
+
@requestor.request_with_username(
|
153
|
+
'update_snaps',
|
154
|
+
events: events.to_json,
|
155
|
+
json: snap_data.to_json
|
156
|
+
)
|
153
157
|
end
|
154
158
|
|
155
159
|
def update_email(email)
|
data/snapcat.gemspec
CHANGED
data/spec/snapcat/client_spec.rb
CHANGED
@@ -157,7 +157,7 @@ describe Snapcat::Client do
|
|
157
157
|
|
158
158
|
describe '#screenshot' do
|
159
159
|
it 'records a screenshot' do
|
160
|
-
skip 'stubbing this one is annoying
|
160
|
+
skip 'stubbing this one is annoying'
|
161
161
|
ux = UserExperience.new
|
162
162
|
ux.login
|
163
163
|
|
@@ -216,7 +216,7 @@ describe Snapcat::Client do
|
|
216
216
|
|
217
217
|
describe '#view' do
|
218
218
|
it 'records a view' do
|
219
|
-
skip 'stubbing this one is annoying
|
219
|
+
skip 'stubbing this one is annoying'
|
220
220
|
ux = UserExperience.new
|
221
221
|
ux.login
|
222
222
|
|