viner 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +66 -2
- data/lib/viner/client.rb +11 -0
- data/lib/viner/version.rb +1 -1
- data/spec/client_spec.rb +26 -1
- data/viner.gemspec +0 -3
- metadata +19 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62d749c5f4286461e080bc01a14e7d2792d00a99
|
4
|
+
data.tar.gz: ae0c9aae42d9f4b43f371ea00e8555efe9c2efe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e562fd8cf213a44ccc646b3fb94a989d74edbb0f10594245e15cdd9f49fd959a814356cef868f8adba73a6561f8df9865b1b2514dc897527bf7d3991c46ea8cb
|
7
|
+
data.tar.gz: 8d3e8fe5d9830fdd5e570280f4b8d18afff3986364464c5eab048bfa3c8ee46367b3690ab97b316d52e8dab66ce9f5bd2b36766bd0f66fb75e4ca375919522e7
|
data/README.md
CHANGED
@@ -1,2 +1,66 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
## Information
|
2
|
+
![vine_logo](https://vine.co/static/images/vine_glyph_2x.png)
|
3
|
+
### viner
|
4
|
+
|
5
|
+
Wrapper to access the unofficial Vine API.
|
6
|
+
|
7
|
+
Vine is currently available for iOS and Android devices. You can download Vine for iOS in the [Apple App Store](https://itunes.apple.com/us/app/vine/id592447445?mt=8), and Vine for Android in the [Google Play Store](https://play.google.com/store/apps/details?id=co.vine.android). After installing Vine on your device, you can sign up using an email address or sign in with your Twitter account.
|
8
|
+
|
9
|
+
An account is needed for all calls to the API.
|
10
|
+
|
11
|
+
[https://viner.herokuapp.com/](https://viner.herokuapp.com/)
|
12
|
+
|
13
|
+
## Requirements
|
14
|
+
|
15
|
+
Ruby >= 2.0
|
16
|
+
|
17
|
+
## Getting started
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem install viner
|
21
|
+
```
|
22
|
+
|
23
|
+
### Start new client
|
24
|
+
```ruby
|
25
|
+
@client = Viner::Client.new
|
26
|
+
```
|
27
|
+
### Login
|
28
|
+
```ruby
|
29
|
+
@client.login("username", "password")
|
30
|
+
```
|
31
|
+
### Logout
|
32
|
+
```ruby
|
33
|
+
@client.logout
|
34
|
+
```
|
35
|
+
### Popular Vines
|
36
|
+
```ruby
|
37
|
+
@client.popular
|
38
|
+
```
|
39
|
+
### Vines by any tag
|
40
|
+
```ruby
|
41
|
+
@client.tag("cats")
|
42
|
+
```
|
43
|
+
### Profiles
|
44
|
+
|
45
|
+
Your profile
|
46
|
+
```ruby
|
47
|
+
@client.profile
|
48
|
+
```
|
49
|
+
|
50
|
+
Find profile
|
51
|
+
```ruby
|
52
|
+
@client.profile(user_id)
|
53
|
+
```
|
54
|
+
### Posts
|
55
|
+
```ruby
|
56
|
+
@client.profile(post_id)
|
57
|
+
```
|
58
|
+
|
59
|
+
### Notifications
|
60
|
+
```ruby
|
61
|
+
@client.profile(user_id)
|
62
|
+
```
|
63
|
+
|
64
|
+
## Running tests
|
65
|
+
|
66
|
+
To run all the tests you need to enter a valid user account username and password in [spec_helper.rb](https://github.com/ahmetabdi/viner/blob/master/spec/spec_helper.rb#L3)
|
data/lib/viner/client.rb
CHANGED
@@ -30,6 +30,11 @@ module Viner
|
|
30
30
|
get('timelines/popular', {}, {})
|
31
31
|
end
|
32
32
|
|
33
|
+
def search(username)
|
34
|
+
# GET https://api.vineapp.com/users/search/<username>
|
35
|
+
get("users/search/#{username}", {}, {}).data.records
|
36
|
+
end
|
37
|
+
|
33
38
|
# Get Tag
|
34
39
|
def tag(tag)
|
35
40
|
# GET https://api.vineapp.com/timelines/tags/<tag>
|
@@ -47,6 +52,12 @@ module Viner
|
|
47
52
|
end
|
48
53
|
end
|
49
54
|
|
55
|
+
def timeline(user_id)
|
56
|
+
# GET https://api.vineapp.com/timelines/users/<userid>
|
57
|
+
result = get("timelines/users/#{user_id}", {}, {})
|
58
|
+
return result.data.records if result.success
|
59
|
+
end
|
60
|
+
|
50
61
|
# Get Single Post
|
51
62
|
def posts(post)
|
52
63
|
# GET https://api.vineapp.com/timelines/posts/<postid>
|
data/lib/viner/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -67,6 +67,31 @@ describe Viner::Client do
|
|
67
67
|
response = @client.notifications
|
68
68
|
response.success.should be_true
|
69
69
|
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "When not authenticated" do
|
73
|
+
before(:each) do
|
74
|
+
@client = Viner::Client.new
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should return an array of users given an existing username" do
|
78
|
+
response = @client.search('KingBach')
|
79
|
+
response.size.should be > 0
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should return an empty array given an invalid username" do
|
83
|
+
response = @client.search('lkjpoqiwekasdmnbzmxnbca')
|
84
|
+
response.should be_empty
|
85
|
+
end
|
70
86
|
|
87
|
+
it "should return an array of a user's timeline given a valid user id" do
|
88
|
+
response = @client.timeline('931427884873170944')
|
89
|
+
response.should be_instance_of Array
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should return nil given an invalid user id" do
|
93
|
+
response = @client.timeline('936189236128367346123123')
|
94
|
+
response.should eq nil
|
95
|
+
end
|
71
96
|
end
|
72
|
-
end
|
97
|
+
end
|
data/viner.gemspec
CHANGED
@@ -19,9 +19,6 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_development_dependency "cucumber"
|
20
20
|
s.add_development_dependency "aruba"
|
21
21
|
|
22
|
-
s.add_dependency "rspec"
|
23
|
-
s.add_dependency "cucumber"
|
24
|
-
s.add_dependency "aruba"
|
25
22
|
s.add_dependency "unirest"
|
26
23
|
s.add_dependency "hashie"
|
27
24
|
|
metadata
CHANGED
@@ -1,139 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmet Abdi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cucumber
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: aruba
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '>='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: cucumber
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '>='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '>='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: aruba
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '>='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '>='
|
66
|
+
- - ">="
|
109
67
|
- !ruby/object:Gem::Version
|
110
68
|
version: '0'
|
111
69
|
- !ruby/object:Gem::Dependency
|
112
70
|
name: unirest
|
113
71
|
requirement: !ruby/object:Gem::Requirement
|
114
72
|
requirements:
|
115
|
-
- -
|
73
|
+
- - ">="
|
116
74
|
- !ruby/object:Gem::Version
|
117
75
|
version: '0'
|
118
76
|
type: :runtime
|
119
77
|
prerelease: false
|
120
78
|
version_requirements: !ruby/object:Gem::Requirement
|
121
79
|
requirements:
|
122
|
-
- -
|
80
|
+
- - ">="
|
123
81
|
- !ruby/object:Gem::Version
|
124
82
|
version: '0'
|
125
83
|
- !ruby/object:Gem::Dependency
|
126
84
|
name: hashie
|
127
85
|
requirement: !ruby/object:Gem::Requirement
|
128
86
|
requirements:
|
129
|
-
- -
|
87
|
+
- - ">="
|
130
88
|
- !ruby/object:Gem::Version
|
131
89
|
version: '0'
|
132
90
|
type: :runtime
|
133
91
|
prerelease: false
|
134
92
|
version_requirements: !ruby/object:Gem::Requirement
|
135
93
|
requirements:
|
136
|
-
- -
|
94
|
+
- - ">="
|
137
95
|
- !ruby/object:Gem::Version
|
138
96
|
version: '0'
|
139
97
|
description: Vine API
|
@@ -143,8 +101,8 @@ executables: []
|
|
143
101
|
extensions: []
|
144
102
|
extra_rdoc_files: []
|
145
103
|
files:
|
146
|
-
- .gitignore
|
147
|
-
- .rspec
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
148
106
|
- Gemfile
|
149
107
|
- Gemfile.lock
|
150
108
|
- LICENSE
|
@@ -166,17 +124,17 @@ require_paths:
|
|
166
124
|
- lib
|
167
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
168
126
|
requirements:
|
169
|
-
- -
|
127
|
+
- - ">="
|
170
128
|
- !ruby/object:Gem::Version
|
171
129
|
version: 2.0.0
|
172
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
131
|
requirements:
|
174
|
-
- -
|
132
|
+
- - ">="
|
175
133
|
- !ruby/object:Gem::Version
|
176
134
|
version: 1.3.6
|
177
135
|
requirements: []
|
178
136
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.1
|
137
|
+
rubygems_version: 2.4.5.1
|
180
138
|
signing_key:
|
181
139
|
specification_version: 4
|
182
140
|
summary: Vine API
|