redvine 0.1 → 0.2

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: 7b6a33f99d78cd7c56d3f38106a674ebeb81c5a9
4
- data.tar.gz: ccd30d81ae90c4833dedbdedd2e245d0a1fef7a1
3
+ metadata.gz: 882d19776aa63e2dcd62ef079b2d21265ef2aac9
4
+ data.tar.gz: fb34c0078ab0abf9e592d5e99c50315f8999aee4
5
5
  SHA512:
6
- metadata.gz: 845cba04456494faedfb305251fe1c8a1eae217ed5558f02668e9c7955a06454f9199e4a8d9021898f32d6ab507a376339f12a4ea0771159d88eea6c0bc1ba06
7
- data.tar.gz: a9a121d3355572e013272497509a326d4f6669701db7ba794c10b623c9030d2ffa85b5d4df5b1d5cb2ea0b55dfe0743144fcded42dd2b48d81403bd6cbc64fa4
6
+ metadata.gz: 17a97a498ee3c9fa40724e8edf3833a0105e8ceeeadb76c1fbd17520b4a9df6cbe8853fd542e3dfe234f4c5b6ad846f20cafa8951f3c1271f2a24e6eae12f4ad
7
+ data.tar.gz: 2d761d32afab9ef4788d7dc38f80adb681a5c13a76bb485677b4bdd2656298984f0a16dbefa48c2e289d974e6a1093d0edc4f5bd62812e869d6c400e529ff66d
data/.gitignore CHANGED
@@ -19,4 +19,5 @@ tmp
19
19
  /.rspec
20
20
  .DS_Store
21
21
  /config.yml
22
- /vcr_cassettes/
22
+ /vcr_cassettes/
23
+ /.rvmrc
@@ -22,7 +22,7 @@ class Redvine
22
22
  attr_reader :vine_key, :username, :user_id
23
23
 
24
24
  @@baseUrl = 'https://api.vineapp.com/'
25
- @@deviceToken = 'Redvine'
25
+ @@deviceToken = SecureRandom.hex 32
26
26
  @@userAgent = 'iphone/1.3.1 (iPhone; iOS 6.1.3; Scale/2.00) (Redvine)'
27
27
 
28
28
  def connect(opts={})
@@ -30,7 +30,6 @@ class Redvine
30
30
  query = {username: opts[:email], password: opts[:password], deviceToken: @@deviceToken}
31
31
  headers = {'User-Agent' => @@userAgent}
32
32
  response = HTTParty.post(@@baseUrl + 'users/authenticate', {body: query, headers: headers})
33
-
34
33
  if opts[:skip_exception] || response['success']
35
34
  @vine_key = response.parsed_response['data']['key']
36
35
  @username = response.parsed_response['data']['username']
@@ -57,6 +56,10 @@ class Redvine
57
56
  get_request_data('timelines/graph', opts)
58
57
  end
59
58
 
59
+ def likes(opts={})
60
+ user_likes(@user_id.to_s, opts)
61
+ end
62
+
60
63
  def following(uid,opts={})
61
64
  raise(ArgumentError, 'You must specify a user id') if !uid
62
65
  get_request_data("users/#{uid}/following", opts)
@@ -77,6 +80,11 @@ class Redvine
77
80
  get_request_data('timelines/users/' + uid, opts)
78
81
  end
79
82
 
83
+ def user_likes(uid, opts={})
84
+ raise(ArgumentError, 'You must specify a user id') if !uid
85
+ get_request_data('timelines/users/' + uid + '/likes', opts)
86
+ end
87
+
80
88
  def single_post(pid)
81
89
  raise(ArgumentError, 'You must specify a post id') if !pid
82
90
  response = get_request_data('/timelines/posts/' + pid)
@@ -1,3 +1,3 @@
1
1
  class Redvine
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
@@ -202,6 +202,26 @@ describe Redvine do
202
202
 
203
203
  end
204
204
 
205
+ describe '.user_likes' do
206
+
207
+ it 'should respond to a user_likes method' do
208
+ expect(client).to respond_to(:user_likes)
209
+ end
210
+
211
+ it 'should throw an error without a user id' do
212
+ expect { client.user_likes() }.to raise_error(ArgumentError)
213
+ end
214
+
215
+ it 'should return a set of results with VideoUrls given a user id with some likes' do
216
+ VCR.use_cassette('redvine', :record => :new_episodes) do
217
+ vines = client.user_likes('1104962313704103936')
218
+ expect(vines.count).to be > 0
219
+ expect(vines.first.videoUrl).to be_an_instance_of(String)
220
+ end
221
+ end
222
+
223
+ end
224
+
205
225
  describe '.user_timeline' do
206
226
 
207
227
  it 'should respond to a user_timeline method' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redvine
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Stakelon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty