linsc 0.0.12 → 0.0.13

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
  SHA1:
3
- metadata.gz: a921c0d961c96ce6b775700e1937513f1e1b7c92
4
- data.tar.gz: e849dd28fdaf09b7e5592cde52a27ee04045205d
3
+ metadata.gz: 860af1f8cbc663cbda78430c095ecf50238c6605
4
+ data.tar.gz: dbc62551110192f40775c0768529351f543a9d2e
5
5
  SHA512:
6
- metadata.gz: 20d14e5800c05b0417b1917e6983c44b05bf2b898d8e3cb601cd952ec846ff13489a2a6eb6368452bc0cb6681361688ea0504a979dc33bc0f253d7d23c6da0a5
7
- data.tar.gz: f763c237238b6f116d69949f04dc9fdae4be1d716dcb2e936ba1f71b6519ea2f4d52f5e36b20bca0ff93f77f8e376c1e8d54f691e43fb01f4b0a5acc25d4ec80
6
+ metadata.gz: a6e6363cf30625e2a359b806a5c1c410e8bc58673ca8a5113acbafdd4e25e804750307cec179bc06f8b519e01318886d22fee4a378352127c32b860d1d3abdfe
7
+ data.tar.gz: 7c617d9559c0e7eac42a178074903a70b72b19997c6d44c59f5dacf174536d10779d38ae79ee1f917ffc93c5c19e45eca9a68c7222f20ff500bd7f338e8f474d
data/README.md CHANGED
@@ -7,8 +7,9 @@
7
7
  - Make sure Powershell is installed
8
8
 
9
9
  - Download the Windows Ruby installer from here: http://rubyinstaller.org/downloads/
10
+ (tested on 2.2.4, but should work on 2.3)
10
11
 
11
- - Install ruby
12
+ - Make sure Powershell is closed, and install ruby (check all 3 boxes)
12
13
 
13
14
  - Open Powershell and run the command:
14
15
  ```ruby
@@ -20,7 +21,7 @@ gem install linsc
20
21
  gem environment
21
22
  ```
22
23
 
23
- - Navigate to the path listed for INSTALLATION DIRECTORY, then gems -> linsc-(version) -> data
24
+ - In your file manager, navigate to the path listed for INSTALLATION DIRECTORY, then gems -> linsc-(version) -> data
24
25
 
25
26
  - Here you will find an empty proxies.txt and recruiters.txt
26
27
 
@@ -42,7 +43,7 @@ LIN4
42
43
 
43
44
  ## Usage
44
45
 
45
- - Download your linkedin connections export csv files and put them in an empty directory. Each of these files should have exactly the same filename as one of the lines from your recruiters.txt file.
46
+ - Download your linkedin connections export csv files and put them in an empty directory. Each of these files should have exactly the same filename as one of the lines from your recruiters.txt file, and should end with .csv.
46
47
  It is expected that these csvs will have the following fields: First Name, Last Name, E-mail Address, Company, Job Title. All other fields are ignored.
47
48
 
48
49
  - Run a Salesforce report and put the csv in the same directory as your LIN files. The required fields for the Salesforce file are: Contact ID, LIN ID, Email.
@@ -8,7 +8,7 @@ class CrossRef
8
8
  def initialize(input_dir:, child_path:, master_path:, output_path:,
9
9
  master_lookup_field: 'Email', child_lookup_field: 'Email',
10
10
  master_secondary_lookups: ['Email 2', 'Email 3'],
11
- static_values: {'Account Name' => 'Candidates'}, options:)
11
+ static_values: {'Account Name' => 'Candidates', 'Account ID' => '00120000019Covx'}, options:)
12
12
  @input_dir, @child_path, @master_path, @output_path, @options =
13
13
  input_dir, child_path, master_path, output_path, options
14
14
  @master_lookup_field, @child_lookup_field, @master_secondary_lookups, @static_values =
@@ -53,7 +53,7 @@ class CrossRef
53
53
  child_lookup_value && master_lookup_value ?
54
54
  child_lookup_value <=> master_lookup_value : child_lookup_value ? -1 : 1
55
55
  end
56
- if !matching_row
56
+ if @master_secondary_lookups && !matching_row
57
57
  matching_row = master_data.find do |master_row|
58
58
  master_secondary_lookups = @master_secondary_lookups.collect{|x| x && x.downcase}
59
59
  master_secondary_lookups.include?(child_lookup_value)
@@ -105,8 +105,10 @@ class CrossRef
105
105
  child_row.each do |child_key, child_value|
106
106
  master_row[child_key] = child_value if master_row.has_key?(child_key)
107
107
  end
108
- @static_values.each do |static_key, static_value|
109
- master_row[static_key] = static_value if master_row.has_key?(static_key)
108
+ if @static_values
109
+ @static_values.each do |static_key, static_value|
110
+ master_row[static_key] = static_value if master_row.has_key?(static_key)
111
+ end
110
112
  end
111
113
  master_row
112
114
  end
data/lib/linsc/lin.rb CHANGED
@@ -60,7 +60,7 @@ class LinScraper
60
60
  @noproxy = options[:noproxy]
61
61
  @proxies = ProxyHandler.new(@cooldown) unless @options[:noproxy]
62
62
  @headers = get_headers(@input_file)
63
- @new_headers = ["Contact ID", "LIN ID", "CV TR", "Account Name", "Linkedin Import Status", "First Name", "Last Name", "Email", "LinkedIn Profile", "Candidate ID",
63
+ @new_headers = ["Contact ID", "LIN ID", "CV TR", "Account Name", "Account ID", "Linkedin Import Status", "First Name", "Last Name", "Email", "LinkedIn Profile", "Candidate ID",
64
64
  "LIN 1st Degree", "Title", "Contact Country", "Contact LIN Sector", "Resume Last Updated", "LIN Import Date", "CV Uploaded",
65
65
  "Employer 1 Title", "Employer Organization Name 1", "Employer 1 Start Date",
66
66
  "Employer 1 End Date", "Employer 1 Location", "Employer 1 Description",
@@ -255,12 +255,16 @@ class LinScraper
255
255
  input_row << ["Linkedin Profile", nil]
256
256
  input_row.delete('Urls')
257
257
  input_row["Linkedin Import Status"] = 'Profile not found'
258
+ input_row["CV TR"] = '0' unless input_row["CV TR"] == '1'
259
+ input_row["CV Uploaded"] = '0' unless input_row["CV Uploaded"] == '1'
258
260
  output_row = create_row(input_row, @headers)
259
261
  puts input_row["Linkedin Import Status"]
260
262
  append_to_csv(@output_update, output_row)
261
263
  elsif @options [:insert]
262
264
  input_row << ["Linkedin Profile", nil]
263
265
  input_row.delete('Urls')
266
+ input_row["CV TR"] = '0'
267
+ input_row["CV Uploaded"] = '0'
264
268
  input_row["Linkedin Import Status"] = 'Profile not found'
265
269
  puts input_row["Linkedin Import Status"]
266
270
  output_row = create_row(input_row, @headers)
@@ -271,12 +275,16 @@ class LinScraper
271
275
  if @options[:update] && input_row['Contact ID'] && input_row['Contact ID'].strip.length > 0
272
276
  input_row << ["Linkedin Profile", nil]
273
277
  input_row.delete('Urls')
278
+ input_row["CV TR"] = '0' unless input_row["CV TR"] == '1'
279
+ input_row["CV Uploaded"] = '0' unless input_row["CV Uploaded"] == '1'
274
280
  puts input_row["Linkedin Import Status"]
275
281
  output_row = create_row(input_row, @headers)
276
282
  append_to_csv(@output_update, output_row)
277
283
  elsif @options [:insert]
278
284
  input_row << ["Linkedin Profile", nil]
279
285
  input_row.delete('Urls')
286
+ input_row["CV TR"] = '0'
287
+ input_row["CV Uploaded"] = '0'
280
288
  puts input_row["Linkedin Import Status"]
281
289
  output_row = create_row(input_row, @headers)
282
290
  append_to_csv(@output_insert, output_row)
data/lib/linsc/parsers.rb CHANGED
@@ -4,6 +4,7 @@ module Parsers
4
4
  name = page.at_css("#name").text.split
5
5
  contact_id = input_row["Contact ID"]
6
6
  lin_id = input_row["LIN ID"]
7
+ account_id = input_row["Account ID"]
7
8
  cv_tr = input_row["CV TR"]
8
9
  acc_name = input_row["Account Name"]
9
10
  import_status = input_row["Linkedin Import Status"]
@@ -227,6 +228,7 @@ module Parsers
227
228
 
228
229
  row["Contact ID"] = contact_id
229
230
  row["LIN ID"] = lin_id
231
+ row["Account ID"] = account_id
230
232
  row["CV TR"] = "1"
231
233
  row["Account Name"] = acc_name
232
234
  row["Linkedin Import Status"] = import_status
data/linsc.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "linsc"
7
- spec.version = "0.0.12"
7
+ spec.version = "0.0.13"
8
8
  spec.authors = ["Dan Molloy"]
9
9
  spec.email = ["danieljmolloy1@gmail.com"]
10
10
  spec.date = '2016-03-31'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Molloy