followers_number 0.0.6 → 0.0.7

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: 360b76607ee36bff2d9c2aaab08692441dd5189cbcfa22c3e605216e5ddfee51
4
- data.tar.gz: 1007d13609d788d4fb3acd37e1b82d31b1013665a7b9bf17e9ef797511c94ce9
3
+ metadata.gz: 16934587498fd73c956762141d13ff5ce8aa443a80f8eb37b5a341a1a8b47099
4
+ data.tar.gz: a144a7da9973cdee0ea135a4a1ba1850a9cbe4ec37433b26490df009ae9d9fb6
5
5
  SHA512:
6
- metadata.gz: 62328452af7b066988dfb1c56e10a3d4a88efac04c2884e3aece2458ad91e52fa758751e0f43574cf18e7732767b43a5b2b1e0ddd111bbc2d1d696e9d538fa4f
7
- data.tar.gz: b5a386b103b45284cd59bf522fd5aa9265a8ad863c5139105e571ff1202ffcb2f7a45663d5b76bea91627ff818cfdf86c767983667fef9ca90de5e2be176092f
6
+ metadata.gz: a9fb964c75d33ebc7f2ee76493d19d8dbc7bd7b895fd823d4340e4fc502ef792bbeb052a85ffac5969aa004ab3c3340d13888c26e0f714e69d1f8443cc8734d3
7
+ data.tar.gz: adb3583ea538d4a848e554e47dfa259be843cc9304b1d7b467d8baebdfa99b629c3c22a4af380bb19337d835a1dc6ed2612bc3e22682dabe4c5f61e876161803
@@ -6,6 +6,7 @@ require_relative 'followers_number/parsers/twitter'
6
6
  require_relative 'followers_number/parsers/instagram'
7
7
  require_relative 'followers_number/parsers/youtube'
8
8
  require_relative 'followers_number/parsers/facebook'
9
+ require_relative 'followers_number/parsers/medium'
9
10
 
10
11
  require_relative 'followers_number/request'
11
12
  require_relative 'followers_number/validator'
@@ -4,7 +4,8 @@ module FollowersNumber
4
4
  'twitter.com' => FollowersNumber::Parsers::Twitter,
5
5
  'instagram.com' => FollowersNumber::Parsers::Instagram,
6
6
  'youtube.com' => FollowersNumber::Parsers::Youtube,
7
- 'facebook.com' => FollowersNumber::Parsers::Facebook
7
+ 'facebook.com' => FollowersNumber::Parsers::Facebook,
8
+ 'medium.com' => FollowersNumber::Parsers::Medium
8
9
  }
9
10
 
10
11
  def self.call(profile_url, response)
@@ -0,0 +1,9 @@
1
+ module FollowersNumber
2
+ module Parsers
3
+ class Medium
4
+ def self.parse(html)
5
+ html.to_s.match(/followerCount":([0-9]*)/)[1]&.to_i
6
+ end
7
+ end
8
+ end
9
+ end
@@ -2,7 +2,7 @@ module FollowersNumber
2
2
  class Validator
3
3
  class InvalidProfileURL < StandardError; end
4
4
 
5
- NETWORKS = %w[twitter.com instagram.com youtube.com facebook.com]
5
+ NETWORKS = %w[twitter.com instagram.com youtube.com facebook.com medium.com]
6
6
 
7
7
  def self.validate!(profile_url)
8
8
  unless NETWORKS.include?(URI.parse(profile_url.to_s.downcase).host)
@@ -6,7 +6,7 @@ module FollowersNumber
6
6
  #
7
7
  # @return [String]
8
8
  def to_s
9
- "0.0.6"
9
+ "0.0.7"
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Dąbrowski
@@ -68,6 +68,7 @@ files:
68
68
  - lib/followers_number/parser.rb
69
69
  - lib/followers_number/parsers/facebook.rb
70
70
  - lib/followers_number/parsers/instagram.rb
71
+ - lib/followers_number/parsers/medium.rb
71
72
  - lib/followers_number/parsers/twitter.rb
72
73
  - lib/followers_number/parsers/youtube.rb
73
74
  - lib/followers_number/request.rb