followers_number 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/followers_number.rb +4 -3
- data/lib/followers_number/parsers/instagram.rb +1 -1
- data/lib/followers_number/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbb73c1ef939f3f45f0bf3fe87afacc6d61fdb16d052b87e52c8c8fc6b60543c
|
4
|
+
data.tar.gz: 82dc3bd643ad49d50616b720698d03f3203894d3cd19c1f5b0905728c8e2bff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec9513e251a49dc8bc0b92118ee8f9c7d002e032202c57a349b4e5360455aeaedd92f0b20a74c88640ce67b94afbc67ab6522f9cb988ac4782014532c855dcd
|
7
|
+
data.tar.gz: fa1b4112f2016442aafb7f7d938f07f3fea85f4eb296a1c97923bd962eca0a896589d81e391a34fdd8b47a7da8636fd41434de2e66dbc8624270895cf85a3e03
|
data/lib/followers_number.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'json'
|
4
|
+
|
1
5
|
require_relative 'followers_number/parsers/twitter'
|
2
6
|
require_relative 'followers_number/parsers/instagram'
|
3
7
|
|
@@ -5,9 +9,6 @@ require_relative 'followers_number/request'
|
|
5
9
|
require_relative 'followers_number/validator'
|
6
10
|
require_relative 'followers_number/parser'
|
7
11
|
|
8
|
-
require 'rest-client'
|
9
|
-
require 'nokogiri'
|
10
|
-
|
11
12
|
module FollowersNumber
|
12
13
|
class << self
|
13
14
|
def for(profile_url)
|
@@ -3,7 +3,7 @@ module FollowersNumber
|
|
3
3
|
class Instagram
|
4
4
|
def self.parse(html)
|
5
5
|
raw_json = html.to_s.match(/window\._sharedData =.*(?=;)/)
|
6
|
-
json = JSON.parse(raw_json.to_s.gsub("window._sharedData = ", ""))
|
6
|
+
json = ::JSON.parse(raw_json.to_s.gsub("window._sharedData = ", ""))
|
7
7
|
json["entry_data"]["ProfilePage"].first["graphql"]["user"]["edge_followed_by"]["count"]
|
8
8
|
end
|
9
9
|
end
|