Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_thanhnd
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
thanhnd
venjob_thanhnd
Commits
591cf6e6
Commit
591cf6e6
authored
Feb 18, 2020
by
thanhnd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix review 20200218
parent
241d47d2
Pipeline
#465
canceled with stages
in 0 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
22 deletions
+13
-22
db/migrate/20200204082233_create_areas.rb
+0
-1
db/migrate/20200204084723_create_cities.rb
+1
-1
db/migrate/20200204084729_create_companies.rb
+1
-1
db/migrate/20200204084733_create_industries.rb
+0
-1
db/migrate/20200204084737_create_industry_jobs.rb
+0
-1
db/migrate/20200204084750_create_saved_jobs.rb
+0
-1
db/migrate/20200204084755_create_applied_jobs.rb
+0
-1
db/schema.rb
+2
-7
lib/tasks/crawler.rake
+9
-8
No files found.
db/migrate/20200204082233_create_areas.rb
View file @
591cf6e6
...
...
@@ -5,6 +5,5 @@ class CreateAreas < ActiveRecord::Migration[6.0]
t
.
string
:area_description
t
.
timestamps
end
add_index
:areas
,
:id
,
unique:
true
end
end
db/migrate/20200204084723_create_cities.rb
View file @
591cf6e6
...
...
@@ -6,6 +6,6 @@ class CreateCities < ActiveRecord::Migration[6.0]
t
.
column
:city_description
,
:string
t
.
timestamps
end
add_index
:cities
,
[
:area_id
,
:id
],
unique:
true
add_index
:cities
,
:area_id
end
end
db/migrate/20200204084729_create_companies.rb
View file @
591cf6e6
...
...
@@ -10,6 +10,6 @@ class CreateCompanies < ActiveRecord::Migration[6.0]
t
.
column
:size
,
:int
t
.
timestamps
end
add_index
:companies
,
[
:id
,
:email
],
unique:
true
add_index
:companies
,
:email
end
end
db/migrate/20200204084733_create_industries.rb
View file @
591cf6e6
...
...
@@ -5,6 +5,5 @@ class CreateIndustries < ActiveRecord::Migration[6.0]
t
.
column
:industry_description
,
:string
t
.
timestamps
end
add_index
:industries
,
:id
,
unique:
true
end
end
db/migrate/20200204084737_create_industry_jobs.rb
View file @
591cf6e6
...
...
@@ -5,6 +5,5 @@ class CreateIndustryJobs < ActiveRecord::Migration[6.0]
t
.
column
:job_id
,
:int
,
:null
=>
false
t
.
timestamps
end
add_index
:industry_jobs
,
:id
,
unique:
true
end
end
db/migrate/20200204084750_create_saved_jobs.rb
View file @
591cf6e6
...
...
@@ -5,6 +5,5 @@ class CreateSavedJobs < ActiveRecord::Migration[6.0]
t
.
column
:job_id
,
:int
,
:null
=>
false
t
.
timestamps
end
add_index
:saved_jobs
,
:id
,
unique:
true
end
end
db/migrate/20200204084755_create_applied_jobs.rb
View file @
591cf6e6
...
...
@@ -5,6 +5,5 @@ class CreateAppliedJobs < ActiveRecord::Migration[6.0]
t
.
column
:job_id
,
:int
,
:null
=>
false
t
.
timestamps
end
add_index
:applied_jobs
,
:id
,
unique:
true
end
end
db/schema.rb
View file @
591cf6e6
...
...
@@ -17,7 +17,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
integer
"job_id"
,
null:
false
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"id"
],
name:
"index_applied_jobs_on_id"
,
unique:
true
end
create_table
"areas"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -25,7 +24,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
string
"area_description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"id"
],
name:
"index_areas_on_id"
,
unique:
true
end
create_table
"cities"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -34,7 +32,7 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
string
"city_description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"area_id"
,
"id"
],
name:
"index_cities_on_area_id_and_id"
,
unique:
true
t
.
index
[
"area_id"
],
name:
"index_cities_on_area_id"
end
create_table
"companies"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -47,7 +45,7 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
integer
"size"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"
id"
,
"email"
],
name:
"index_companies_on_id_and_email"
,
unique:
true
t
.
index
[
"
email"
],
name:
"index_companies_on_email"
end
create_table
"industries"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -55,7 +53,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
string
"industry_description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"id"
],
name:
"index_industries_on_id"
,
unique:
true
end
create_table
"industry_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -63,7 +60,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
integer
"job_id"
,
null:
false
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"id"
],
name:
"index_industry_jobs_on_id"
,
unique:
true
end
create_table
"jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -87,7 +83,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
integer
"job_id"
,
null:
false
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"id"
],
name:
"index_saved_jobs_on_id"
,
unique:
true
end
create_table
"users"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
lib/tasks/crawler.rake
View file @
591cf6e6
...
...
@@ -29,18 +29,19 @@ namespace :crawler do
uri
=
URI
::
encode
(
url
)
job
=
Nokogiri
::
HTML
(
open
(
uri
))
detail_selector
=
'#showScroll .DetailJobNew'
title
=
job
.
css
(
'.top-job-info h1'
)
company_name
=
job
.
css
(
'.top-job-info
div
.tit_company'
)
company_name
=
job
.
css
(
'.top-job-info .tit_company'
)
updated_date
=
job
.
css
(
'.datepost span'
)
location
=
job
.
css
(
'#showScroll .DetailJobNew li[1].bgLine1 p[1].fl_left b a[2]'
)
experience
=
job
.
css
(
'#showScroll .DetailJobNew li[2].bgLine2 p[1].fl_left > text()'
)
industry
=
job
.
css
(
'#showScroll .DetailJobNew li[3].bgLine1 p[1].fl_left b'
)
level
=
job
.
css
(
'#showScroll .DetailJobNew .bgLine1 .fl_right label'
)
salary
=
job
.
css
(
'#showScroll .DetailJobNew .bgLine2 .fl_right label'
)
deadline
=
job
.
css
(
'#showScroll .DetailJobNew li[3].bgLine1 p[2].fl_right > text()'
)
location
=
job
.
css
(
"
#{
detail_selector
}
li[1].bgLine1 p[1].fl_left b a[2]"
)
experience
=
job
.
css
(
"
#{
detail_selector
}
li[2].bgLine2 p[1].fl_left > text()"
)
industry
=
job
.
css
(
"
#{
detail_selector
}
li[3].bgLine1 p[1].fl_left b"
)
level
=
job
.
css
(
"
#{
detail_selector
}
.bgLine1 .fl_right label"
)
salary
=
job
.
css
(
"
#{
detail_selector
}
.bgLine2 .fl_right label"
)
deadline
=
job
.
css
(
"
#{
detail_selector
}
li[3].bgLine1 p[2].fl_right > text()"
)
description
=
job
.
css
(
'.MarBot20'
)
address
=
job
.
css
(
'.box1Detail .TitleDetailNew label label'
)
company_intro
=
job
.
css
(
'
.desc_company.content_fck span
#emp_more'
)
company_intro
=
job
.
css
(
'#emp_more'
)
#skip if field blank
next
if
industry
.
text
.
blank?
...
...
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