instagram_feed_by_hashtag 0.0.9 → 0.1.0

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: 4859ae9637b8ca46356a43f15fb29037664fcf1f
4
- data.tar.gz: 28292f94eda02f6d2ba1ac646d1eed5104cdaf3e
3
+ metadata.gz: 04400fdf570d3bcb360e96ca31552427142e66bb
4
+ data.tar.gz: 008ee2b0c6e13108a7d7b66f472c90e22b1c70a7
5
5
  SHA512:
6
- metadata.gz: 0ffdca05bb9ad1c5937dafcc6f998b828385c567a6c9324d5bf3e135488d52d78bb73dc094478091035675105aed85ebddfb5d60b81281327d027b7bc0be6c4e
7
- data.tar.gz: 369b8d8d96bb5896c871a4202c9af67edc547287960edf57ce86712484dc3ba257cde20d79f4e243733e7345be1b1b848c7fdb6b70129dbcacd344b6310438ee
6
+ metadata.gz: 6f576c33d89338fe13d8081c47ad07c44a3058cdbda779953f73f09d37ce6f6aef746e668fa773af3b2d7a8c6bda126b0a68ec4722b37bb96fd2700ae8d586e7
7
+ data.tar.gz: 87dfc2451bd8d9e7c3ddbacfa7fac73d33c0605f453495e09e99d144f79302e95c7a5970b25db19fad7de0fe60f13296199e646231469027a59ef78f08017422
@@ -1,3 +1,3 @@
1
1
  module InstagramFeedByHashtag
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -26,7 +26,7 @@ end
26
26
 
27
27
  module Instagramfeedbyhashtag
28
28
 
29
- def self.feed(hashtag, count)
29
+ def feed(hashtag, how_many)
30
30
  require 'net/http'
31
31
  url_raw = 'https://www.instagram.com/explore/tags/'+ hashtag +'/?__a=1'
32
32
  url = URI.parse("#{url_raw}")
@@ -38,8 +38,8 @@ module Instagramfeedbyhashtag
38
38
  unless resp == false
39
39
  result = []
40
40
  parsed_json = JSON.parse(resp)
41
- for i in 0..(count.to_i -1)
42
- result << parsed_json['media']['nodes'][i]
41
+ for i in 0..(how_many - 1)
42
+ result << parsed_json['tag']['media']['nodes'][i] unless parsed_json['tag']['media']['nodes'][i].nil?
43
43
  end
44
44
  end
45
45
  result
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instagram_feed_by_hashtag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Prauze