Sha256: 85fa5608b12fe06683438564d2c20289aab94beee852c2afdf2cd41bca9d18f6

Contents?: true

Size: 597 Bytes

Versions: 2

Compression:

Stored size: 597 Bytes

Contents

module IndeedJobsearch
  module SearchResultsFetcher
    def self.fetch(query, location, page_number)
      page = SearchPage.new(query, location, page_number)
      results = page.nodes.map do |node|
        search_result(node)
      end
    end

    private

    def self.search_result(node)
      SearchResult.new(
        job_title: node.text('.jobtitle'),
        company: node.text('.company'),
        location: node.text('.location'),
        time_since_posting: node.text('.date'),
        time_scraped: Time.now,
        url: 'http://www.indeed.com' + node.url
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
indeed_jobsearch-0.1.1 lib/indeed_jobsearch/search_results_fetcher.rb
indeed_jobsearch-0.1.0 lib/indeed_jobsearch/search_results_fetcher.rb