tsjobcrawler 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a212b7a46a370480a3ae9c2afba75cf674129648
4
- data.tar.gz: a7c4c870904574b3d4626ff871d61139864c823c
3
+ metadata.gz: 6f61cfc63f1645221d7346792579a958cf22df40
4
+ data.tar.gz: 985c42f6a4f2ce6f207d8d4f3f773738f3cf02ed
5
5
  SHA512:
6
- metadata.gz: 9aa2c9f4224570efb6e7ceea302aec24a89cb70470ea62beff0dd32fb2717ce2970b3ddf9d8bb8fbfd293bf2461716986f2964d75f0920e122e31fcd71921444
7
- data.tar.gz: a9e9015f39aaded4eeaf57ab03d5a9ea5ae31a8bb37bdb35639c4dd056b93d759c3cb26f3831a8515e3996bad5b9f0f828589f28cbebdee60ebd69bb4a60bd0e
6
+ metadata.gz: fe1856420422090a2787f22cff70d71ca7a6ee32a0404b80b09d61297385e964a3d1ab8a3f1f66eae142f8cb1c704596e48d9d548b49dad4056b7ba6ab932497
7
+ data.tar.gz: d347d928ef2214ad4a0364e801a99b7d113d42baa15a509a947fcc7f60d98414907c2be4ae66ddaac83789211a7bde25f22f0a6f1471692de48564d3063abefc
@@ -24,7 +24,7 @@ class ClearanceJobsComCrawler
24
24
  # Run the crawler
25
25
  def crawl
26
26
  page_count = get_page_count
27
-
27
+
28
28
  (1..page_count).each do |page_num|
29
29
  listing_links = collect_links_on_page(get_next_page(page_num))
30
30
  parse_listings(listing_links)
@@ -36,13 +36,17 @@ class ClearanceJobsComCrawler
36
36
  if @search_term == nil
37
37
  @base_url = "https://www.clearancejobs.com/jobs?"
38
38
  else
39
- @base_url = "https://www.clearancejobs.com/jobs?keywords="+CGI.escape(@search_term)+"&zip_text="
39
+ @base_url = "https://www.clearancejobs.com/jobs?keywords="+CGI.escape(@search_term)
40
40
  end
41
41
  end
42
42
 
43
43
  # Get the URL for the next page
44
44
  def get_next_page_url(page_num)
45
- return @base_url+"PAGE="+page_num.to_s+"&limit=25"
45
+ if @base_url.include?("keywords")
46
+ return @base_url+"&PAGE="+page_num.to_s+"&limit=25"
47
+ else
48
+ return @base_url+"PAGE="+page_num.to_s+"&limit=25"
49
+ end
46
50
  end
47
51
 
48
52
  # Get the page
@@ -39,7 +39,8 @@ class ClearanceJobsComParser
39
39
  rescue
40
40
  @i += 1
41
41
  if @i < 10
42
- @html = Nokogiri::HTML.parse(get_retry(@url, @requests, @i))
42
+ @html = get_retry(@url, @requests, @i)
43
+ @page = Nokogiri::HTML.parse(@html)
43
44
  parse
44
45
  end
45
46
  end
@@ -76,7 +76,7 @@ class ClearedJobsNetCrawler
76
76
  found_listings.push(parser.parse_job)
77
77
  end
78
78
 
79
- @reporter.report_results(found_listings, listing_links.first)
79
+ @reporter.report_results(found_listings, listing_links.first[:url])
80
80
  end
81
81
 
82
82
  # Gets the number of pages for the query
@@ -15,8 +15,8 @@ class TSJobCrawler
15
15
 
16
16
  # Crawl all of the listing sites
17
17
  def crawl_jobs
18
- cleared_jobs_net
19
18
  clearance_jobs_com
19
+ cleared_jobs_net
20
20
  security_cleared_jobs_com
21
21
  end
22
22
 
@@ -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 = "tsjobcrawler"
7
- spec.version = '0.1.2'
7
+ spec.version = '0.1.3'
8
8
  spec.authors = ["M. C. McGrath"]
9
9
  spec.email = ["shidash@shidash.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsjobcrawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. C. McGrath