linked_in_archive_to_resume 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3b6c59f75b08323c19f35c831ca5af248dc13a3
4
+ data.tar.gz: 1dc5e3a9ee68a932a86472291f8a9cd3f005f3ac
5
+ SHA512:
6
+ metadata.gz: 90d28b7b1e019a5648f221a618a709b7473ee8908d6432fca87ae93f699e87c8843b0f7e7f2015015b4171e1cf3b8a7808a95f78d06046c5fbb42463f51cf6c5
7
+ data.tar.gz: 0d7f141409af36960ff0bfed8295bff16418e47953939ce3c6305d01dbcb97ef39c21354e07d4499f64c9cdce8fd6b1835488852214eb7ddd16fe096e1286e00
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .irb-history
2
+ data
3
+ resume.html
4
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "haml"
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ haml (5.0.4)
5
+ temple (>= 0.8.0)
6
+ tilt
7
+ temple (0.8.0)
8
+ tilt (2.0.8)
9
+
10
+ PLATFORMS
11
+ ruby
12
+
13
+ DEPENDENCIES
14
+ haml
15
+
16
+ BUNDLED WITH
17
+ 1.13.3
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006-2017 Scott Barron
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ LinkedIn Archive to Resume
2
+ ============
3
+
4
+ Basic Resume from LinkedIn Archive
5
+
6
+ Description
7
+ -----------
8
+
9
+ I dislike maintaining my resume, after going through the trouble of maintaining my LinkedIn profile.
10
+ So, why not kill two birds with one stone? So, I wrote this bit of code as an attempt to accomplish
11
+ this goal.
12
+
13
+ Installation
14
+ ------------
15
+
16
+ `gem install linked_in_archive_to_resume`
17
+
18
+ Usage
19
+ -----
20
+
21
+ Download a copy of your LinkedIn archive: https://www.linkedin.com/psettings/member-data
22
+
23
+ You only need to download the *Profile* data, but you may as well grab the whole shebang, as the
24
+ profile part gets sent before the rest.
25
+
26
+ Unzip the archive and `cd` into it
27
+
28
+ Execute `linked_in_archive_to_resume` in that directory
29
+
30
+ Open the resulting `resume.html` in your browser
31
+
32
+ Options
33
+ -------
34
+
35
+ `linked_in_archive_to_resume -h` shows you the couple of options available. For further customization,
36
+ you will need to fork this repo and tweak the code.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/assets/print.css ADDED
@@ -0,0 +1,42 @@
1
+ @media print {
2
+ #content,
3
+ #page {
4
+ width: 100%;
5
+ margin: 0;
6
+ float: none;
7
+ }
8
+ @page {
9
+ margin: 2cm
10
+ }
11
+
12
+ a {
13
+ color: #000;
14
+ text-decoration: none;
15
+ }
16
+
17
+ h1,
18
+ h2,
19
+ h3,
20
+ h4,
21
+ h5,
22
+ h6 {
23
+ page-break-after: avoid;
24
+ page-break-inside: avoid
25
+ }
26
+ img {
27
+ page-break-inside: avoid;
28
+ page-break-after: avoid;
29
+ }
30
+ table,
31
+ pre {
32
+ page-break-inside: avoid
33
+ }
34
+ ul,
35
+ ol,
36
+ dl {
37
+ page-break-before: avoid
38
+ }
39
+ .page-break-before {
40
+ page-break-before: always;
41
+ }
42
+ }
data/assets/style.css ADDED
@@ -0,0 +1,63 @@
1
+ h1, h3, h4, a, .section-title, .contact, .address, .dates {
2
+ font-family: Montserrat;
3
+ }
4
+
5
+ h3 {
6
+ font-size: 12pt;
7
+ margin: 0;
8
+ }
9
+
10
+ a, .contact, .address {
11
+ font-size: 10pt;
12
+ }
13
+
14
+ .address {
15
+ float: right;
16
+ }
17
+
18
+ p {
19
+ margin: 7px 0;
20
+ }
21
+
22
+
23
+ h1 {
24
+ font-size: 24pt;
25
+ margin-bottom: 1px;
26
+ }
27
+
28
+ h1 small {
29
+ font-size: 14pt;
30
+ color: #666;
31
+ }
32
+
33
+ h2 {
34
+ font-size: 12pt;
35
+ }
36
+
37
+ h2 small {
38
+ font-size: 8pt;
39
+ text-transform: none;
40
+ font-family: Arial;
41
+ font-weight: normal;
42
+ }
43
+
44
+ h4 {
45
+ margin-bottom: 5px;
46
+ }
47
+
48
+ p.dates {
49
+ margin: 1px 0;
50
+ font-size: 10pt;
51
+ }
52
+
53
+ h4 {
54
+ font-size: 10pt;
55
+ }
56
+
57
+ .section-title {
58
+ text-transform: uppercase;
59
+ }
60
+
61
+ .section-title, .email-address, .dates {
62
+ color: #666;
63
+ }
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require "builder"
4
+
5
+ Builder.call(ARGV)
data/lib/builder.rb ADDED
@@ -0,0 +1,43 @@
1
+ require "haml"
2
+ require "csv"
3
+ require "builder_opts"
4
+ require "fileutils"
5
+
6
+ class Builder
7
+ def self.call(argv)
8
+ @options = BuilderOpts.parse(argv)
9
+
10
+ @profile = CSV.open("Profile.csv", headers: true).readlines.first
11
+
12
+ CSV.open("Email Addresses.csv", headers: true).each do |row|
13
+ if row["Primary"] == "Yes"
14
+ @primary_email = row["Email Address"]
15
+ end
16
+ end
17
+
18
+ @experience_rows = CSV.open("Positions.csv", headers: true).readlines.map do |row|
19
+ row["Description"] = row["Description"].gsub(/\n+/, "</p><p>")
20
+ row
21
+ end
22
+ @project_rows = CSV.open("Projects.csv", headers: true).readlines.sort_by do |row|
23
+ Date.strptime(row["Start Date"], "%b %Y")
24
+ end.reverse
25
+ @education_rows = CSV.open("Education.csv", headers: true).readlines
26
+ recommendation_rows = CSV.open("Recommendations Received.csv", headers: true).readlines
27
+ @recommendations_hash = {}
28
+ recommendation_rows.each do |row|
29
+ if @recommendations_hash[row["Company"]].nil?
30
+ @recommendations_hash[row["Company"]] = []
31
+ end
32
+ @recommendations_hash[row["Company"]] << row
33
+ end
34
+
35
+ template_path = File.join(File.dirname(__FILE__),"template.haml")
36
+ engine = Haml::Engine.new(open(template_path).read)
37
+ File.open("resume.html","w") do |ofile|
38
+ ofile.puts engine.render(self)
39
+ end
40
+ styles = File.join(File.dirname(__FILE__),"..","assets","*")
41
+ FileUtils.cp(Dir.glob(styles), ".")
42
+ end
43
+ end
@@ -0,0 +1,32 @@
1
+ require "optparse"
2
+ require "ostruct"
3
+
4
+ class BuilderOpts
5
+ def self.parse(args)
6
+ options = OpenStruct.new
7
+ options.show_projects = false
8
+ options.show_recommendations = false
9
+
10
+ opt_parser = OptionParser.new do |opts|
11
+ opts.banner = "Usage: linked_in_archive_to_resume [options]"
12
+ opts.separator ""
13
+ opts.separator "Specific options:"
14
+
15
+ opts.on("-p", "--[no-]show-projects", "Show projects") do |projects|
16
+ options.show_projects = projects
17
+ end
18
+
19
+ opts.on("-r", "--[no-]show-recommendations", "Show recommendations") do |recom|
20
+ options.show_recommendations = recom
21
+ end
22
+
23
+ opts.on_tail("-h", "--help", "Show this message") do
24
+ puts opts
25
+ exit
26
+ end
27
+ end
28
+
29
+ opt_parser.parse!(args)
30
+ options
31
+ end
32
+ end
data/lib/template.haml ADDED
@@ -0,0 +1,93 @@
1
+ %html
2
+ %head
3
+ %link{ href: "style.css", rel: "stylesheet" }
4
+ %link{ href: "pring.css", rel: "stylesheet", media: "print" }
5
+ %link{ href: "https://fonts.googleapis.com/css?family=Montserrat", rel: "stylesheet" }
6
+ %body
7
+ %section
8
+ %article
9
+ %header
10
+ %h1
11
+ = @profile["First Name"]
12
+ = @profile["Last Name"]
13
+ %small= @profile["Headline"]
14
+ %p.contact
15
+ .address
16
+ Quechee, Vt
17
+
18
+ %a{href:"mailto:#{@primary_email}"}= @primary_email
19
+ - if linked_in = @profile["LinkedIn"]
20
+ |
21
+ %a{href:"#{linked_in}"}= linked_in.sub(%r{.*(/in.*)/?},"\1")
22
+ - if phone = @profile["Phone"]
23
+ |
24
+ %a{href:"tel:+1#{phone}"}= phone.sub(/(\d{3})(\d{3})(\d{4})/,"\1.\2.\3")
25
+
26
+ %hr
27
+ %section
28
+ %h2.section-title Summary
29
+ %p= @profile["Summary"]
30
+
31
+ %hr
32
+ %section
33
+ %h2.section-title
34
+ Experience
35
+ - if !@options.show_projects
36
+ %small (see LinkedIn for complete history - including projects)
37
+ - for row in @experience_rows
38
+ %h3
39
+ = row["Title"]
40
+ at
41
+ = row["Company Name"]
42
+ %p.dates
43
+ = row["Started On"]
44
+ \-
45
+ = row["Finished On"] || "Present"
46
+ %p= row["Description"]
47
+
48
+ - if @options.show_projects
49
+ %hr
50
+ %section
51
+ %h2.section-title Projects
52
+ - for row in @project_rows
53
+ %h3
54
+ = row["Title"]
55
+ %p.dates
56
+ = row["Start Date"]
57
+ - if row["End Date"]
58
+ \-
59
+ = row["End Date"]
60
+ %p= row["Description"]
61
+ - if row["URL"]
62
+ %p
63
+ URL:
64
+ = row["URL"]
65
+
66
+ %hr
67
+ %section
68
+ %h2.section-title Education
69
+ - for row in @education_rows
70
+ %h3
71
+ = row["School Name"]
72
+ %p
73
+ - if row["Degree Name"]
74
+ = "#{row["Degree Name"]}, "
75
+ = row["Start Date"]
76
+ \-
77
+ = "#{row["End Date"]}, "
78
+ - if row["GPA"]
79
+ = row["GPA"]
80
+
81
+ - if @options.show_recommendations
82
+ %hr
83
+ %section
84
+ %h2.section-title Recommendations
85
+ - @recommendations_hash.each do |company, rows|
86
+ %h3
87
+ = company
88
+ - for row in rows
89
+ %h3
90
+ = row["First Name"]
91
+ = row["Last Name"]
92
+ %p
93
+ = row["Text"].gsub(/’/,"'")
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "linked_in_archive_to_resume"
3
+ s.version = "1.0.0"
4
+ s.summary = %{LinkedIn Archive to HTML Resume.}
5
+ s.description = %Q{}
6
+ s.author = ["Chris Hoffman"]
7
+ s.email = ["chris.c.hoffman@gmail.com"]
8
+ s.homepage = "http://github.com/hoffmanc/linked_in_archive_to_resume"
9
+ s.license = "MIT"
10
+ s.files = `git ls-files`.split("\n")
11
+ s.executables << "linked_in_archive_to_resume"
12
+
13
+ s.add_dependency "haml"
14
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: linked_in_archive_to_resume
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Hoffman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: haml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: ''
28
+ email:
29
+ - chris.c.hoffman@gmail.com
30
+ executables:
31
+ - linked_in_archive_to_resume
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".gitignore"
36
+ - Gemfile
37
+ - Gemfile.lock
38
+ - LICENSE.txt
39
+ - README.md
40
+ - Rakefile
41
+ - assets/print.css
42
+ - assets/style.css
43
+ - bin/linked_in_archive_to_resume
44
+ - lib/builder.rb
45
+ - lib/builder_opts.rb
46
+ - lib/template.haml
47
+ - linked_in_archive_to_resume.gemspec
48
+ homepage: http://github.com/hoffmanc/linked_in_archive_to_resume
49
+ licenses:
50
+ - MIT
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 2.5.1
69
+ signing_key:
70
+ specification_version: 4
71
+ summary: LinkedIn Archive to HTML Resume.
72
+ test_files: []