ruby-instagram-scraper 0.1.5

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/ruby-instagram-scraper.rb +36 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f7681fbcbcd6256179d71f6243085cef05e0464
4
+ data.tar.gz: 1cbc71f09248aebc1f69f5662d922a03a50528ee
5
+ SHA512:
6
+ metadata.gz: 294208a612c8ab0495f11a821836f5386518e1f6e0523c409b15a9d026e6cf18ed2a8d08f32abe14b14fd1af1ec2c948b473f940d06da33fde73124c4255718b
7
+ data.tar.gz: c27bc22454a529e88a72f3f54b07ac59e1aa68b0f4a89c2d9e03a82bac882cd673d48806689fe3d402609fb1786bb51ebad48511ff586303cd20947fdd973052
@@ -0,0 +1,36 @@
1
+ require 'open-uri'
2
+ require 'json'
3
+
4
+ module RubyInstagramScraper
5
+
6
+ def self.search ( query )
7
+ url = "https://www.instagram.com/web/search/topsearch/"
8
+ params = "?query=#{ query }"
9
+
10
+ JSON.parse( open( url + params ).read )
11
+ end
12
+
13
+ def self.get_user_media_nodes ( username, max_id = nil )
14
+ url = "https://www.instagram.com/#{ username }/?__a=1"
15
+ params = ""
16
+ params = "&max_id=#{ max_id }" if max_id
17
+
18
+ JSON.parse( open( url + params ).read )["user"]["media"]["nodes"]
19
+ end
20
+
21
+ def self.get_tag_media_nodes ( tag, max_id = nil )
22
+ url = "https://www.instagram.com/explore/tags/#{ tag }/?__a=1"
23
+ params = ""
24
+ params = "&max_id=#{ max_id }" if max_id
25
+
26
+ JSON.parse( open( url + params ).read )["tag"]["media"]["nodes"]
27
+ end
28
+
29
+ def self.get_media ( code )
30
+ url = "https://www.instagram.com/p/#{ code }/?__a=1"
31
+ params = ""
32
+
33
+ JSON.parse( open( url + params ).read )["media"]
34
+ end
35
+
36
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-instagram-scraper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
+ platform: ruby
6
+ authors:
7
+ - Sergey Borodanov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: А simple module for requests to Instagram without an API key.
14
+ email: s.borodanov@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/ruby-instagram-scraper.rb
20
+ homepage: https://github.com/sborod/ruby-instagram-scraper
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.4
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: А simple module for requests to Instagram without an API key.
44
+ test_files: []