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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 420049d0bc7d33ee524611b6bde310aed680d73846fbd16e3130de3d66bc808a
4
- data.tar.gz: 3493baaf531d026a22fb278eac4c5256fa51e2114d594c693b3acb4d76d3ccaa
3
+ metadata.gz: dbb73c1ef939f3f45f0bf3fe87afacc6d61fdb16d052b87e52c8c8fc6b60543c
4
+ data.tar.gz: 82dc3bd643ad49d50616b720698d03f3203894d3cd19c1f5b0905728c8e2bff1
5
5
  SHA512:
6
- metadata.gz: 5caee59e56e489edc7f5dbd703e256e236234e45b3eaed3cd4e7db8ebdb97bfd50bbb4b834a92541d758d8232140c2814dcb3a45f83c52a611587deb5da96d98
7
- data.tar.gz: 2047e6b916f124c45426696ec20cdc408e87a727512754f03579c8446ba8755cc09a66a972fb48ed8dd3a555f9826a289d816a88d2d2dcbad63de378549da6ce
6
+ metadata.gz: aec9513e251a49dc8bc0b92118ee8f9c7d002e032202c57a349b4e5360455aeaedd92f0b20a74c88640ce67b94afbc67ab6522f9cb988ac4782014532c855dcd
7
+ data.tar.gz: fa1b4112f2016442aafb7f7d938f07f3fea85f4eb296a1c97923bd962eca0a896589d81e391a34fdd8b47a7da8636fd41434de2e66dbc8624270895cf85a3e03
@@ -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
@@ -6,7 +6,7 @@ module FollowersNumber
6
6
  #
7
7
  # @return [String]
8
8
  def to_s
9
- "0.0.2"
9
+ "0.0.3"
10
10
  end
11
11
  end
12
12
  end
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Dąbrowski