instagram_feed_by_hashtag 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/instagram_feed_by_hashtag.rb +2 -1
- 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: a80db331a45eda63f6a644911a56a4a03f432bb9
|
4
|
+
data.tar.gz: dc0256e2af5e9d9947f91394a7126ee6fe751671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3966391a3359d50a7f195a4f1820dcf7deae5a3e3054e7e37a2776d28d1cdd76277e993768e685832616f1c1fa06f57b67442a499f26a0cf8080339aa6a28b55
|
7
|
+
data.tar.gz: 561651c75b97d6a3e0ebd110c8b2727b3ec028ed990b2fd52f107a25d9d1321262d11e61146149e6360749f376fb25fdefd3be3b2b7822ce1ccded8337c2469e
|
data/README.md
CHANGED
@@ -21,16 +21,25 @@ Or install it yourself as:
|
|
21
21
|
## Usage
|
22
22
|
|
23
23
|
|
24
|
-
Usage:
|
24
|
+
Usage: InstagramFeedByHashtag.feed(hashtag, count) # hashtag => string; count => integer.
|
25
25
|
|
26
|
-
Example:
|
26
|
+
Example: InstagramFeedByHashtag.feed('cars', 6) # Returns an JSON with 6 latest pics tagged with 'cars'.
|
27
27
|
|
28
|
-
Full example: feed =
|
28
|
+
Full example: feed = InstagramFeedByHashtag.feed( 'cars', 6 ) # Make request and store JSON in feed variable
|
29
29
|
@images = [] # Define array
|
30
30
|
for i in 0..(feed.count - 1) # Loop through feed
|
31
31
|
@images << feed[i]['display_src'] unless feed[i].nil? # Grab images URLs and store them in @images
|
32
32
|
end
|
33
33
|
|
34
|
+
In this JSON, you can find: ['display_src']
|
35
|
+
['code']
|
36
|
+
['owner']['id']
|
37
|
+
['caption']
|
38
|
+
['likes']
|
39
|
+
['thumbnail_src']
|
40
|
+
|
41
|
+
|
42
|
+
|
34
43
|
## Contributing
|
35
44
|
|
36
45
|
Bug reports and pull requests are welcome on GitHub at https://github.com/eduardoprauze/instagram_feed_by_hashtag.
|
@@ -2,7 +2,7 @@ require "instagram_feed_by_hashtag/version"
|
|
2
2
|
|
3
3
|
module InstagramFeedByHashtag
|
4
4
|
|
5
|
-
def feed(hashtag, how_many)
|
5
|
+
def self.feed(hashtag, how_many)
|
6
6
|
require 'net/http'
|
7
7
|
url_raw = 'https://www.instagram.com/explore/tags/'+ hashtag +'/?__a=1'
|
8
8
|
url = URI.parse("#{url_raw}")
|
@@ -22,3 +22,4 @@ module InstagramFeedByHashtag
|
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
25
|
+
|