followers_number 0.0.4 → 0.0.5
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: 0b245a9fe94280efa09b8247bea217416d42b920f15e623601314f277f0f35a8
|
4
|
+
data.tar.gz: 16288ef59f639f89e2cbe93a77e1a8d8bddbcba042b4d1bfdc918ec9efcf1c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08a74883b21741cb5fb7797a63c9ed4d24a5bf73fdb8d4f1713bab08e27b8a175455824913ccbd766941b813b447889b983be35bdd1c4e0be3bf5db9a463752c
|
7
|
+
data.tar.gz: 329230437d1c176ea00af24ce0adb5ae1bd282a0a3512deb52384133ec07bbf80a32ad9a8fc23d074517cc0104357563f97abb505ea8bffbd2acb4820138b90b
|
@@ -3,7 +3,8 @@ module FollowersNumber
|
|
3
3
|
MAPPING = {
|
4
4
|
'twitter.com' => FollowersNumber::Parsers::Twitter,
|
5
5
|
'instagram.com' => FollowersNumber::Parsers::Instagram,
|
6
|
-
'youtube.com' => FollowersNumber::Parsers::Youtube
|
6
|
+
'youtube.com' => FollowersNumber::Parsers::Youtube,
|
7
|
+
'facebook.com' => FollowersNumber::Parsers::Facebook
|
7
8
|
}
|
8
9
|
|
9
10
|
def self.call(profile_url, response)
|
@@ -1,7 +1,14 @@
|
|
1
1
|
module FollowersNumber
|
2
2
|
class Request
|
3
3
|
def self.get(profile_url)
|
4
|
-
|
4
|
+
headers = {
|
5
|
+
"Content-Language" => "en-US",
|
6
|
+
"Accept-Language" => "en-US",
|
7
|
+
"user-agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
|
8
|
+
"Cookie" => ""
|
9
|
+
}
|
10
|
+
|
11
|
+
::RestClient::Request.execute(method: :get, url: profile_url, headers: headers)
|
5
12
|
end
|
6
13
|
end
|
7
14
|
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]
|
5
|
+
NETWORKS = %w[twitter.com instagram.com youtube.com facebook.com]
|
6
6
|
|
7
7
|
def self.validate!(profile_url)
|
8
8
|
unless NETWORKS.include?(URI.parse(profile_url.to_s.downcase).host)
|
data/lib/followers_number.rb
CHANGED
@@ -5,6 +5,7 @@ require 'json'
|
|
5
5
|
require_relative 'followers_number/parsers/twitter'
|
6
6
|
require_relative 'followers_number/parsers/instagram'
|
7
7
|
require_relative 'followers_number/parsers/youtube'
|
8
|
+
require_relative 'followers_number/parsers/facebook'
|
8
9
|
|
9
10
|
require_relative 'followers_number/request'
|
10
11
|
require_relative 'followers_number/validator'
|
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.5
|
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/facebook.rb
|
69
70
|
- lib/followers_number/parsers/instagram.rb
|
70
71
|
- lib/followers_number/parsers/twitter.rb
|
71
72
|
- lib/followers_number/parsers/youtube.rb
|