linkout 0.1.1 → 0.1.2

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: e665313acd373d377a96346abf253a1b8975b934
4
- data.tar.gz: 34cffd61dee0800451b6fae476b5643994411000
3
+ metadata.gz: db320009473c80564afaf17e69fcaa7cfa7b4dea
4
+ data.tar.gz: c6ea53f2f63ccd4c5baa8eb062896998aba42da4
5
5
  SHA512:
6
- metadata.gz: 171a5692741d788816c389d2394e14343d30ebd1fd66c7867cfa6f7072335b1c949d253fdb608d97a0326a6ca0b6ad0427da5020b2c5247de5ab22c65ac18995
7
- data.tar.gz: eab60b107a0dcabce9e77da186c2f897530e56f59e42b0f81bd3622addf4e26cf991d2c1d0f3db42683f23476a2d7ca7f8fbcd9ed954973c06ca2267b9d20ca6
6
+ metadata.gz: 022b11b0e485a01423335b202f4d68e68cf74082b399787fb2ba137bef3cb584b785489d8654a6461d0a7cecdbc795d487a2b5dd050c5ed9f10025314260842b
7
+ data.tar.gz: 709d8b6447d90b0c438fe6888092886fb9ab243d8c696c1e935b4d8edf519cf2fe0dd7fdc0248e2b94a9b02d42696c126839a90530df934d6b5ce48bd9474499
@@ -5,7 +5,7 @@ require 'open-uri'
5
5
 
6
6
  module Linkout
7
7
  class Profile
8
- attr_accessor :url, :name,:basic_info, :full_info
8
+ attr_accessor :url, :name,:basic_info, :full_info, :clean_tags
9
9
  def initialize(profile_url, params={})
10
10
  @url = profile_url
11
11
  @doc = Nokogiri::HTML(open(@url))
@@ -15,13 +15,30 @@ module Linkout
15
15
  end
16
16
 
17
17
  def basic_info
18
- current_title = Sanitize.fragment(@doc.css('.title').first).strip
19
- current_location = Sanitize.fragment(@doc.css('.locality').first).strip
20
- current_industry = Sanitize.fragment(@doc.css('.descriptor')[1]).strip
21
- {current_title: current_title, current_location:current_location, current_industry: current_industry }
18
+ @basics = {}
19
+ @basics[:current_title] = Sanitize.fragment(@doc.css('.title').first).strip
20
+ @basics[:current_location] = Sanitize.fragment(@doc.css('.locality').first).strip
21
+ @basics[:current_industry] = Sanitize.fragment(@doc.css('.descriptor')[1]).strip
22
+ return @basics
22
23
  end
23
24
  def full_info
24
- {educations: [], experiences:[], certifications:[], languages:[], projects:[], skills:[], courses:[]}
25
+ @full = {}
26
+ @full[:educations] = @doc.css('.school').map { |data| clean_tags(data)}
27
+ @full[:experiences] = @doc.css('.position').map { |data| clean_tags(data)}
28
+ @full[:certifications] = @doc.css('.certification').map { |data| clean_tags(data)}
29
+ @full[:languages] = @doc.css('.language').map { |data| clean_tags(data)}
30
+ @full[:courses] = @doc.css('.course').map { |data| clean_tags(data)}
31
+ @full[:projects] = @doc.css('.project').map { |data| clean_tags(data)}
32
+ return @full
33
+ end
34
+
35
+ def clean_tags(data)
36
+ Sanitize.fragment(data).strip
37
+ Sanitize.fragment(data).strip
38
+ Sanitize.fragment(data).strip
39
+ Sanitize.fragment(data).strip
40
+ Sanitize.fragment(data).strip
41
+ Sanitize.fragment(data).strip
25
42
  end
26
43
  end
27
44
  end
@@ -1,3 +1,3 @@
1
1
  module Linkout
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linkout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlSayed Gamal