Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
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
0
Merge Requests
0
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
Huỳnh Thiên Phước
venjob
Commits
ff7e4214
Commit
ff7e4214
authored
Jul 27, 2020
by
Huynh Thien Phuoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created crontab
parent
b7d32095
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
.~lock.jobs.csv#
+0
-2
jobs.csv
+0
-0
lib/src/crontab.rb
+9
-10
No files found.
.~lock.jobs.csv#
deleted
100644 → 0
View file @
b7d32095
,phuocht,devops-OptiPlex-3010,27.07.2020 10:41,file:///home/phuocht/.config/libreoffice/4;
\ No newline at end of file
jobs.csv
View file @
ff7e4214
This source diff could not be displayed because it is too large. You can
view the blob
instead.
lib/src/crontab.rb
View file @
ff7e4214
...
@@ -6,17 +6,16 @@ class Crontab
...
@@ -6,17 +6,16 @@ class Crontab
if
link
.
include?
(
'\u2019'
)
if
link
.
include?
(
'\u2019'
)
link
.
gsub!
(
'\u2019'
,
"'"
)
link
.
gsub!
(
'\u2019'
,
"'"
)
end
end
if
link
==
'javascript:void(0);'
next
if
link
==
'javascript:void(0);'
next
elsif
link
!=
'https://careerbuilder.vn/vi/nha-tuyen-dung/hr-vietnam\xE2\x80\x99s-ess-client.35A4EFBA.html'
elsif
link
!=
'https://careerbuilder.vn/vi/nha-tuyen-dung/hr-vietnam\xE2\x80\x99s-ess-client.35A4EFBA.html'
company_page
=
Nokogiri
::
HTML
(
URI
.
open
(
URI
.
parse
(
UR
I
.
escape
(
link
))))
company_page
=
Nokogiri
::
HTML
(
URI
.
open
(
URI
.
parse
(
CG
I
.
escape
(
link
))))
if
company_page
.
search
(
'p.name'
).
text
!=
nil
if
!
(
company_page
.
search
(
'p.name'
).
text
).
nil?
begin
begin
name_company
=
company_page
.
search
(
'p.name'
).
text
name_company
=
company_page
.
search
(
'p.name'
).
text
address_company
=
company_page
.
css
(
'div.content p'
).
children
[
1
].
text
address_company
=
company_page
.
css
(
'div.content p'
).
children
[
1
].
text
introduction_company
=
company_page
.
css
(
'div.main-about-us'
).
text
introduction_company
=
company_page
.
css
(
'div.main-about-us'
).
text
get_name_company
=
Company
.
find_by
(
name:
"
#{
name_company
}
"
)
get_name_company
=
Company
.
find_by
(
name:
name_company
)
if
get_name_company
==
nil
if
get_name_company
.
nil?
company
=
Company
.
create!
(
name:
name_company
,
company
=
Company
.
create!
(
name:
name_company
,
address:
address_company
,
address:
address_company
,
introduction:
introduction_company
)
introduction:
introduction_company
)
...
@@ -35,17 +34,17 @@ class Crontab
...
@@ -35,17 +34,17 @@ class Crontab
if
link
.
include?
(
'\u2013'
)
if
link
.
include?
(
'\u2013'
)
link
.
gsub!
(
'\u2013'
,
'–'
)
link
.
gsub!
(
'\u2013'
,
'–'
)
end
end
page_job
=
Nokogiri
::
HTML
(
URI
.
open
(
URI
.
parse
(
UR
I
.
escape
(
link
))))
page_job
=
Nokogiri
::
HTML
(
URI
.
open
(
URI
.
parse
(
CG
I
.
escape
(
link
))))
get_row
=
page_job
.
search
(
'div.bg-blue div.row'
)
get_row
=
page_job
.
search
(
'div.bg-blue div.row'
)
if
get_row
!=
""
if
get_row
!=
""
get_name_company
=
page_job
.
search
(
'div.job-desc a.job-company-name'
).
text
.
strip
get_name_company
=
page_job
.
search
(
'div.job-desc a.job-company-name'
).
text
.
strip
company_table
=
Company
.
find_by
(
name:
"
#{
get_name_company
}
"
)
company_table
=
Company
.
find_by
(
name:
get_name_company
)
title_job
=
page_job
.
search
(
'div.job-desc p'
).
text
title_job
=
page_job
.
search
(
'div.job-desc p'
).
text
description
=
page_job
.
search
(
'div.detail-row'
)
description
=
page_job
.
search
(
'div.detail-row'
)
arr_column
=
get_row
.
css
(
'div.has-background'
).
map
{
|
data
|
data
.
text
.
split
(
' '
).
join
(
' '
)
}
arr_column
=
get_row
.
css
(
'div.has-background'
).
map
{
|
data
|
data
.
text
.
split
(
' '
).
join
(
' '
)
}
job_table
=
Job
.
find_by
(
title:
"
#{
title_job
}
"
)
job_table
=
Job
.
find_by
(
title:
title_job
)
arr_column
.
each_with_index
do
|
val
,
key
|
arr_column
.
each_with_index
do
|
val
,
key
|
if
company_table
!=
nil
if
!
company_table
.
nil?
if
val
.
include?
(
'Ngày cập nhật'
)
if
val
.
include?
(
'Ngày cập nhật'
)
arr_data
=
val
.
gsub
(
'Ngày cập nhật '
,
''
).
split
(
' '
)
arr_data
=
val
.
gsub
(
'Ngày cập nhật '
,
''
).
split
(
' '
)
date
=
arr_data
.
first
date
=
arr_data
.
first
...
...
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