jobboards-parser 0.0.6 → 0.0.7

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.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "jobboards-parser"
3
- s.version = "0.0.6"
3
+ s.version = "0.0.7"
4
4
  s.date = "2010-05-15"
5
5
  s.summary = "Simple ruby library for parsing tech jobboards"
6
6
  s.email = "g.marcilhacy@gmail.com"
@@ -11,8 +11,8 @@ module JobboardsParser
11
11
  (open_feed.items || []).inject([]) do |acc, item|
12
12
  title = item.title.split(":").last.strip
13
13
  url = item.link
14
- location = item.description.split("\n").each {|ugly|
15
- next unless ugly.include?("Location"); ugly.split(">").last.strip }
14
+ location = item.description.split("\n").select {|ugly|
15
+ ugly.include?("Location")}.last.split("Location").last.strip
16
16
  company = item.title.split(":").first.strip
17
17
  description = item.description
18
18
  published_at = item.pubDate
@@ -11,8 +11,8 @@ module JobboardsParser
11
11
  (open_feed.items || []).inject([]) do |acc, item|
12
12
  title = item.title.split(" at ").first.strip
13
13
  url = item.link
14
- location = nil
15
- company = item.title.split(" at ").last.strip
14
+ location = item.description.split("</strong>").first.split("<strong>").last.gsub("(","").gsub(")","").strip
15
+ company = item.title.split(" at ").last.split(":").first.strip
16
16
  description = item.description
17
17
  published_at = item.pubDate
18
18
 
@@ -13,7 +13,7 @@ module JobboardsParser
13
13
  url = item.link
14
14
  location = item.title.split(" in ").last.strip
15
15
  company = item.title.split(" at ").last.split("in").first.strip
16
- description = item.description
16
+ description = item.content
17
17
  published_at = item.updated
18
18
 
19
19
  acc << self.new(title, url, location, company, description, published_at).attributes
@@ -13,8 +13,8 @@ module JobboardsParser
13
13
  url = item.link
14
14
  location = item.title.split(" is looking for a").last.split(" in").last.strip
15
15
  company = item.title.split(" is looking for a").first.strip
16
- description = item.description
17
- published_at = item.pudDate
16
+ description = Jobboard.extract_description(item.link)
17
+ published_at = item.pubDate
18
18
 
19
19
  acc << self.new(title, url, location, company, description, published_at).attributes
20
20
  acc
@@ -9,11 +9,11 @@ module JobboardsParser
9
9
 
10
10
  def self.parse
11
11
  (open_feed.items || []).inject([]) do |acc, item|
12
- title = item.title.split(" at ").first.strip
12
+ title = item.title.split(" at:").first.strip
13
13
  url = item.guid
14
14
  location = item.title.split(" at:").last.strip
15
- company = nil
16
- description = item.description
15
+ company = "n/a"
16
+ description = Jobboard.extract_description(item.guid)
17
17
  published_at = item.pudDate
18
18
 
19
19
  acc << self.new(title, url, location, company, description, published_at).attributes
@@ -11,7 +11,7 @@ module JobboardsParser
11
11
  (open_feed.items || []).inject([]) do |acc, item|
12
12
  title = item.title.split("-")[1].strip
13
13
  url = item.link
14
- location = item.title.split("-")[2].split("(").last.split(")").first.strip
14
+ location = item.title.split("(").last.split(")").first.strip
15
15
  company = item.title.split("-")[1].strip
16
16
  description = extract_description(item.link)
17
17
  published_at = item.updated
@@ -1,13 +1,14 @@
1
1
  module JobboardsParser
2
2
  module Jobboard
3
3
  class Jobboard
4
+ attr_accessor :title, :url, :location, :company, :description, :published_at
4
5
 
5
6
  def initialize(title, url, location, company, description, published_at)
6
7
  @title = title
7
8
  @url = url
8
9
  @location = location
9
10
  @company = company
10
- @description = description
11
+ @description = htmlize(description)
11
12
  @published_at = published_at
12
13
  end
13
14
 
@@ -24,10 +25,6 @@ module JobboardsParser
24
25
  attrs
25
26
  end
26
27
 
27
- def description=(text)
28
- @description = htmlize(text)
29
- end
30
-
31
28
  def self.feed
32
29
  JobboardsParser::BOARDS[ActiveSupport::Inflector.underscore(self.to_s.gsub(/^.*::/, '')).to_sym][:url]
33
30
  end
@@ -44,7 +41,7 @@ module JobboardsParser
44
41
  def self.extract_description(url)
45
42
  page = Boilerpipe.extract(url, { :output => :json })
46
43
  content = ActiveSupport::JSON.decode(page)["response"]["content"] rescue ""
47
- content
44
+ content.gsub("\n", "<br />")
48
45
  end
49
46
 
50
47
  private
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobboards-parser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Gr\xC3\xA9gory Marcilhacy"