instagram_feed_by_hashtag 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/instagram_feed_by_hashtag.rb +1 -6
- data/lib/instagram_feed_by_hashtag/version.rb +1 -1
- 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: 099ab3f58f8f33426075889309b14ff5edbf2b44
|
4
|
+
data.tar.gz: 634d5caaaae8c2c0df9c5b2b36d713061f70b037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91ca2d0315e64c981d68afb458cd6fbf4e1f784ceb265ed1765f162a218fff95f83ab2793541f7b337618fd6fdd036d960f1f7b9f64d5b02a0880ed040598ff
|
7
|
+
data.tar.gz: b6aec60cf1169e5cc6ce37196552f791f001d88c0470a5c17c1f27e2667a6509cf251eafec548cbafbaae7bc28e1a9f6f87151cbb0e0cac4fa571bcda52712e1
|
@@ -21,7 +21,6 @@ module InstagramFeedByHashtag
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
result
|
24
|
-
p 'finalizou o result'
|
25
24
|
end
|
26
25
|
|
27
26
|
|
@@ -32,23 +31,19 @@ module Instagramfeedbyhashtag
|
|
32
31
|
def self.feed(hashtag, count)
|
33
32
|
require 'net/http'
|
34
33
|
url = URI.parse("https://www.instagram.com/query/?q=ig_hashtag%28#{hashtag}%29+%7B+media.first%28#{count}%29+%7B+count%2C+nodes+%7B+caption%2C+code%2C+comments+%7B+count+%7D%2C+date%2C+display_src%2C+id%2C+is_video%2C+likes+%7B+count+%7D%2C+owner+%7B+id%2C+username%2C+full_name%2C+profile_pic_url+%7D%2C+thumbnail_src%2C+video_views%2C+video_url+%7D%2C+page_info+%7D+%7D")
|
35
|
-
p 'foi o http'
|
36
34
|
begin
|
37
35
|
resp = Net::HTTP.get(url)
|
38
36
|
rescue Errno::ETIMEDOUT, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse => e
|
39
37
|
resp = false
|
40
38
|
end
|
41
39
|
unless resp == false
|
42
|
-
p 'vai dar o parse'
|
43
40
|
result = []
|
44
41
|
parsed_json = JSON.parse(resp)
|
45
|
-
|
46
|
-
for i in 1..6
|
42
|
+
for i in 1..count
|
47
43
|
result << parsed_json['media']['nodes'][i]
|
48
44
|
end
|
49
45
|
end
|
50
46
|
result
|
51
|
-
p 'finalizou o result'
|
52
47
|
end
|
53
48
|
|
54
49
|
|