Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ngô Trung Hưng
venjob_nth
Commits
33c084b5
Commit
33c084b5
authored
Aug 03, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rubocop
parent
d2e14dc8
Pipeline
#758
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
lib/src/crawler.rb
+1
-1
lib/src/crawler_job.rb
+9
-8
No files found.
lib/src/crawler.rb
View file @
33c084b5
...
@@ -41,7 +41,7 @@ class Crawler
...
@@ -41,7 +41,7 @@ class Crawler
end
end
website_companies
.
select
(
&
:present?
)
website_companies
.
select
(
&
:present?
)
rescue
StandardError
=>
e
rescue
StandardError
=>
e
logger
.
error
"Crawler link on page have error
#{
e
}
"
logger
.
error
"Crawler link on page have error
#{
e
}
"
end
end
def
craw_data_cities
def
craw_data_cities
...
...
lib/src/crawler_job.rb
View file @
33c084b5
...
@@ -12,6 +12,7 @@ class CrawlerJob < Crawler
...
@@ -12,6 +12,7 @@ class CrawlerJob < Crawler
link_jobs
.
each
do
|
val
|
link_jobs
.
each
do
|
val
|
link
=
val
.
value
link
=
val
.
value
return
website_jobs
if
link
.
include?
(
link_make_stop_crawler
)
return
website_jobs
if
link
.
include?
(
link_make_stop_crawler
)
website_jobs
<<
link
website_jobs
<<
link
end
end
end
end
...
@@ -21,7 +22,7 @@ class CrawlerJob < Crawler
...
@@ -21,7 +22,7 @@ class CrawlerJob < Crawler
end
end
def
parse_data
def
parse_data
@
box_links
||=
crawl_link
.
reverse!
@
parse_data
||=
crawl_link
.
reverse!
end
end
def
refresh_first_link
def
refresh_first_link
...
@@ -46,13 +47,13 @@ class CrawlerJob < Crawler
...
@@ -46,13 +47,13 @@ class CrawlerJob < Crawler
def
add_data
(
data
)
def
add_data
(
data
)
id_company
=
(
Company
.
find_by
name:
data
[
:company_name
]).
try
(
:id
)
||
COMPANY_SECURITY
id_company
=
(
Company
.
find_by
name:
data
[
:company_name
]).
try
(
:id
)
||
COMPANY_SECURITY
job
=
Job
.
create
(
name:
data
[
:name
],
job
=
Job
.
create
(
name:
data
[
:name
],
company_id:
id_company
,
company_id:
id_company
,
level:
data
[
:level
],
level:
data
[
:level
],
experience:
data
[
:exprience
],
experience:
data
[
:exprience
],
salary:
data
[
:salary
],
salary:
data
[
:salary
],
create_date:
data
[
:created_date
],
create_date:
data
[
:created_date
],
expiration_date:
data
[
:expiration_date
],
expiration_date:
data
[
:expiration_date
],
description:
data
[
:description
])
description:
data
[
:description
])
create_industry_relation
(
data
[
:industry_name
],
job
)
create_industry_relation
(
data
[
:industry_name
],
job
)
create_city_relation
(
data
[
:city_name
],
job
)
create_city_relation
(
data
[
:city_name
],
job
)
rescue
StandardError
=>
e
rescue
StandardError
=>
e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment