followers_number 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 420049d0bc7d33ee524611b6bde310aed680d73846fbd16e3130de3d66bc808a
|
4
|
+
data.tar.gz: 3493baaf531d026a22fb278eac4c5256fa51e2114d594c693b3acb4d76d3ccaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5caee59e56e489edc7f5dbd703e256e236234e45b3eaed3cd4e7db8ebdb97bfd50bbb4b834a92541d758d8232140c2814dcb3a45f83c52a611587deb5da96d98
|
7
|
+
data.tar.gz: 2047e6b916f124c45426696ec20cdc408e87a727512754f03579c8446ba8755cc09a66a972fb48ed8dd3a555f9826a289d816a88d2d2dcbad63de378549da6ce
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module FollowersNumber
|
2
|
+
module Parsers
|
3
|
+
class Instagram
|
4
|
+
def self.parse(html)
|
5
|
+
raw_json = html.to_s.match(/window\._sharedData =.*(?=;)/)
|
6
|
+
json = JSON.parse(raw_json.to_s.gsub("window._sharedData = ", ""))
|
7
|
+
json["entry_data"]["ProfilePage"].first["graphql"]["user"]["edge_followed_by"]["count"]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/followers_number.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: followers_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Dąbrowski
|
@@ -66,6 +66,7 @@ extra_rdoc_files: []
|
|
66
66
|
files:
|
67
67
|
- lib/followers_number.rb
|
68
68
|
- lib/followers_number/parser.rb
|
69
|
+
- lib/followers_number/parsers/instagram.rb
|
69
70
|
- lib/followers_number/parsers/twitter.rb
|
70
71
|
- lib/followers_number/request.rb
|
71
72
|
- lib/followers_number/validator.rb
|