instagram_feed_by_hashtag 0.1.0 → 0.1.1
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 -26
- 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: afbdfc2a46ce3d6b5dd3a089c4320241ac3cc808
|
4
|
+
data.tar.gz: 7a4f2d443c0cc2974e95eb87e0fe9ff2e303dd35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7599a9fbe628fe79d67a39c2ded9c8b39604cfea4d5080ff076354c7b9274484469bc74e3daedef6a7f197fdbd4f318afc7135e3c307a4b9bd7d93a6b2121737
|
7
|
+
data.tar.gz: 10ac0e508e05beecdc840432e6e1027fe2fe5fc6335894fe834d48b64c850db0c9f09dad2606e567782ebb11a49522eaf6712e4c7ca1204dbffff301d13c0419
|
@@ -2,30 +2,6 @@ require "instagram_feed_by_hashtag/version"
|
|
2
2
|
|
3
3
|
module InstagramFeedByHashtag
|
4
4
|
|
5
|
-
def self.feed(hashtag, count)
|
6
|
-
require 'net/http'
|
7
|
-
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")
|
8
|
-
p 'foi o http'
|
9
|
-
begin
|
10
|
-
resp = Net::HTTP.get(url)
|
11
|
-
rescue Errno::ETIMEDOUT, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse => e
|
12
|
-
resp = false
|
13
|
-
end
|
14
|
-
unless resp == false
|
15
|
-
p 'vai dar o parse'
|
16
|
-
result = []
|
17
|
-
parsed_json = JSON.parse(resp)
|
18
|
-
p parsed_json
|
19
|
-
for i in 1..6
|
20
|
-
result << parsed_json['media']['nodes'][i]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
result
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module Instagramfeedbyhashtag
|
28
|
-
|
29
5
|
def feed(hashtag, how_many)
|
30
6
|
require 'net/http'
|
31
7
|
url_raw = 'https://www.instagram.com/explore/tags/'+ hashtag +'/?__a=1'
|
@@ -45,5 +21,4 @@ module Instagramfeedbyhashtag
|
|
45
21
|
result
|
46
22
|
end
|
47
23
|
|
48
|
-
|
49
|
-
end
|
24
|
+
end
|