linkedin-scraper 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linkedin_scraper/profile.rb +22 -3
- data/lib/linkedin_scraper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51ab67fc48225482a632be818fe7dc158c089cd2
|
4
|
+
data.tar.gz: 355c19cec2f5613b7dc8afd668e845dc406a3134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fd8ef9fba5d09b4ceb466cffb94d6f8327eacd10cf18ced217715374c7931d9a1b7c8a4ddb94445f8652af71c31e07ae862184acba37f0bfe8209ae1e9b7a52
|
7
|
+
data.tar.gz: fa66286cb67770d52151d190e2f4b23ab3a3ebcc80d3201d6c87e3bf3b39ca98ca74254a4041e612a59c4b3d50a5ddcae90d5eaba9da53017da4116efe7224af
|
@@ -2,7 +2,25 @@
|
|
2
2
|
module Linkedin
|
3
3
|
class Profile
|
4
4
|
|
5
|
-
USER_AGENTS = ["Windows IE 6", "Windows IE 7", "Windows Mozilla", "Mac Safari", "Mac Firefox", "Mac Mozilla", "Linux Mozilla", "Linux Firefox", "Linux Konqueror"]
|
5
|
+
#USER_AGENTS = ["Windows IE 6", "Windows IE 7", "Windows Mozilla", "Mac Safari", "Mac Firefox", "Mac Mozilla", "Linux Mozilla", "Linux Firefox", "Linux Konqueror"]
|
6
|
+
USER_AGENTS = [
|
7
|
+
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6",
|
8
|
+
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:5.0) Gecko/20100101 Firefox/5.0",
|
9
|
+
"Mozilla/5.0 (Windows NT 6.1.1; rv:5.0) Gecko/20100101 Firefox/5.0",
|
10
|
+
"Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0",
|
11
|
+
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.825.0 Chrome/14.0.825.0 Safari/535.1",
|
12
|
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.824.0 Safari/535.1",
|
13
|
+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0) Gecko/20100101 Firefox/5.0",
|
14
|
+
"Mozilla/5.0 (Macintosh; PPC MacOS X; rv:5.0) Gecko/20110615 Firefox/5.0",
|
15
|
+
"Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))",
|
16
|
+
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)",
|
17
|
+
"Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)",
|
18
|
+
"Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
|
19
|
+
"Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
|
20
|
+
"Opera/9.80 (X11; Linux x86_64; U; fr) Presto/2.9.168 Version/11.50",
|
21
|
+
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
|
22
|
+
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; da-dk) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
|
23
|
+
]
|
6
24
|
ATTRIBUTES = %w(
|
7
25
|
name
|
8
26
|
first_name
|
@@ -29,6 +47,7 @@ module Linkedin
|
|
29
47
|
|
30
48
|
attr_reader :page, :linkedin_url
|
31
49
|
|
50
|
+
# support old version
|
32
51
|
def self.get_profile(url, options = {})
|
33
52
|
Linkedin::Profile.new(url, options)
|
34
53
|
rescue => e
|
@@ -201,7 +220,7 @@ module Linkedin
|
|
201
220
|
start_date, end_date = node.at(".meta").text.strip.split(" – ") rescue nil
|
202
221
|
company[:duration] = node.at(".meta").text[/.*\((.*)\)/, 1]
|
203
222
|
company[:start_date] = parse_date(start_date) rescue nil
|
204
|
-
|
223
|
+
|
205
224
|
if end_date && end_date.match(/Present/)
|
206
225
|
company[:end_date] = "Present"
|
207
226
|
else
|
@@ -242,7 +261,7 @@ module Linkedin
|
|
242
261
|
|
243
262
|
def http_client
|
244
263
|
Mechanize.new do |agent|
|
245
|
-
agent.
|
264
|
+
agent.user_agent = USER_AGENTS.sample
|
246
265
|
unless @options.empty?
|
247
266
|
agent.set_proxy(@options[:proxy_ip], @options[:proxy_port], @options[:username], @options[:password])
|
248
267
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkedin-scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yatish Mehta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.5.1
|
98
|
+
rubygems_version: 2.4.5.1
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: when a url of public linkedin profile page is given it scrapes the entire
|