social_net 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/lib/social_net/instagram/models/user.rb +3 -3
- data/lib/social_net/version.rb +1 -1
- data/spec/social_net/instagram/models/user_spec.rb +4 -4
- data/spec/support/cassettes/SocialNet_Instagram_Models_User/_videos/given_an_existing_user/returns_an_array_of_video_posts_from_the_user.yml +887 -0
- metadata +3 -3
- data/spec/support/cassettes/SocialNet_Instagram_Models_User/_posts/given_an_existing_user/returns_an_array_of_posts_from_the_user.yml +0 -883
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec838ad570a00f54e721234700fe4904d96c2aa6
|
4
|
+
data.tar.gz: b1fb9ba571da10b71cb32c60a4913ec8e62ccae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6aa6f702c2ebd840c1f6a057a064a54a43ab34419f16d54ae2a798521dcb7b490701ae060a8487830597a58cec162e74ca31bb007c53a3a8414d543f3ad75d5
|
7
|
+
data.tar.gz: 934f9fb405eef8d90f303754c010b29b7a5576bb60b9d528d4473b6a6038ac88dea5a5de611a02ee36f9ab2ffedce9c2c7faa292b8650b722e28c88fe3fc48ac
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ After [configuring your Instagram app](#configuring-your-instagram-app), you can
|
|
18
18
|
user = SocialNet::Instagram::User.find_by username: 'Collab'
|
19
19
|
user.username #=> "Collab"
|
20
20
|
user.follower_count #=> 7025
|
21
|
-
user.
|
21
|
+
user.videos #=>
|
22
22
|
# [SocialNet::Instagram::Models::Video
|
23
23
|
# @caption='Diet starts Monday... 😂🍩',
|
24
24
|
# @file='https://scontent.cdninstagram.com/t50.2886-16/17192719_791273527696774_5253726776697290752_n.mp4',
|
@@ -81,7 +81,7 @@ Use [SocialNet::Instagram::User]() to:
|
|
81
81
|
* retrieve an Instagram user by username
|
82
82
|
* retrieve an Instagram user by id
|
83
83
|
* access the number of followers of an Instagram user
|
84
|
-
* retrieve recent
|
84
|
+
* retrieve recent videos of an Instagram user
|
85
85
|
|
86
86
|
```ruby
|
87
87
|
user = SocialNet::Instagram::User.find_by username: 'collab'
|
@@ -90,7 +90,7 @@ user.follower_count #=> 24198
|
|
90
90
|
user = SocialNet::Instagram::User.find_by id: 270587948
|
91
91
|
user.follower_count #=> 24198
|
92
92
|
|
93
|
-
user.
|
93
|
+
user.videos #=>
|
94
94
|
# [SocialNet::Instagram::Models::Video
|
95
95
|
# @caption='Diet starts Monday... 😂🍩',
|
96
96
|
# @file='https://scontent.cdninstagram.com/t50.2886-16/17192719_791273527696774_5253726776697290752_n.mp4',
|
@@ -13,10 +13,10 @@ module SocialNet
|
|
13
13
|
@follower_count = attrs['counts']['followed_by']
|
14
14
|
end
|
15
15
|
|
16
|
-
# Returns the existing Instagram user's
|
16
|
+
# Returns the existing Instagram user's most recent videos
|
17
17
|
#
|
18
|
-
# @return [SocialNet::Instagram::Models::Video] when the
|
19
|
-
def
|
18
|
+
# @return [SocialNet::Instagram::Models::Video] when the videos are found.
|
19
|
+
def videos
|
20
20
|
request = Api::Request.new endpoint: "users/#{id}/media/recent"
|
21
21
|
videos = request.run.select {|p| p['type'] == 'video'}
|
22
22
|
videos.map {|r| SocialNet::Instagram::Video.new r }
|
data/lib/social_net/version.rb
CHANGED
@@ -49,14 +49,14 @@ describe SocialNet::Instagram::User, :vcr do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
describe '.
|
52
|
+
describe '.videos' do
|
53
53
|
subject(:user) { SocialNet::Instagram::User.find_by! username: username }
|
54
54
|
context 'given an existing user' do
|
55
55
|
let(:username) { existing_username }
|
56
56
|
|
57
|
-
it 'returns an array of posts from the user' do
|
58
|
-
expect(user.
|
59
|
-
expect(user.
|
57
|
+
it 'returns an array of video posts from the user' do
|
58
|
+
expect(user.videos).to be_an Array
|
59
|
+
expect(user.videos.first).to be_an_instance_of SocialNet::Instagram::Video
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|