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
3e39495d
Commit
3e39495d
authored
Aug 07, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename some files
parent
ee5eb9e1
Pipeline
#842
failed with stages
in 0 seconds
Changes
9
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
5 deletions
+11
-5
app/views/industries/_industry.html.erb
+0
-0
app/views/industries/index.html.erb
+1
-1
app/views/jobs/_job.html.erb
+0
-0
app/views/jobs/index.html.erb
+1
-1
app/views/layouts/_show_city.html.erb
+0
-0
app/views/layouts/_show_industry.html.erb
+0
-0
app/views/layouts/_show_job.html.erb
+0
-0
app/views/top_pages/index.html.erb
+3
-3
lib/src/crawler.rb
+6
-0
No files found.
app/views/industries/_
all_industries
.html.erb
→
app/views/industries/_
industry
.html.erb
View file @
3e39495d
File moved
app/views/industries/index.html.erb
View file @
3e39495d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"all-industries"
>
<div
class=
"all-industries"
>
<div
class=
"industry-banner rounded"
>
Industry List
</div>
<div
class=
"industry-banner rounded"
>
Industry List
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<%=
render
partial:
"
all_industries
"
,
collection:
@industries
,
as: :industry
%>
<%=
render
partial:
"
industry
"
,
collection:
@industries
,
as: :industry
%>
</div>
</div>
</div>
</div>
</div>
</div>
app/views/jobs/_
all_jobs
.html.erb
→
app/views/jobs/_
job
.html.erb
View file @
3e39495d
File moved
app/views/jobs/index.html.erb
View file @
3e39495d
...
@@ -8,6 +8,6 @@
...
@@ -8,6 +8,6 @@
<div
class=
"col-4"
><strong>
Result for: ... jobs
</strong></div>
<div
class=
"col-4"
><strong>
Result for: ... jobs
</strong></div>
</div>
</div>
<div
class=
"job-list"
>
<div
class=
"job-list"
>
<%=
render
partial:
"
all_jobs
"
,
collection:
@jobs_list
,
as: :job
%>
<%=
render
partial:
"
job
"
,
collection:
@jobs_list
,
as: :job
%>
</div>
</div>
</div>
</div>
app/views/layouts/_show_cit
ies
.html.erb
→
app/views/layouts/_show_cit
y
.html.erb
View file @
3e39495d
File moved
app/views/layouts/_show_industr
ies
.html.erb
→
app/views/layouts/_show_industr
y
.html.erb
View file @
3e39495d
File moved
app/views/layouts/_show_job
s
.html.erb
→
app/views/layouts/_show_job.html.erb
View file @
3e39495d
File moved
app/views/top_pages/index.html.erb
View file @
3e39495d
...
@@ -10,12 +10,12 @@
...
@@ -10,12 +10,12 @@
<%=
render
'layouts/search_bar'
%>
<%=
render
'layouts/search_bar'
%>
</div>
</div>
<div
class=
"job-list"
>
<div
class=
"job-list"
>
<%=
render
partial:
"layouts/show_job
s
"
,
collection:
@jobs
,
as: :job
%>
<%=
render
partial:
"layouts/show_job"
,
collection:
@jobs
,
as: :job
%>
</div>
</div>
<div
class=
"city-banner rounded"
>
City
</div>
<div
class=
"city-banner rounded"
>
City
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<%=
render
partial:
"layouts/show_cit
ies
"
,
collection:
@jobs_of_cities
,
as: :city
%>
<%=
render
partial:
"layouts/show_cit
y
"
,
collection:
@jobs_of_cities
,
as: :city
%>
</div>
</div>
<div
class=
"all-city"
>
<div
class=
"all-city"
>
<%=
link_to
cities_path
do
%>
<%=
link_to
cities_path
do
%>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</div>
</div>
<div
class=
"industry-banner rounded"
>
Industry
</div>
<div
class=
"industry-banner rounded"
>
Industry
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<%=
render
partial:
"layouts/show_industr
ies
"
,
collection:
@jobs_of_industries
,
as: :industry
%>
<%=
render
partial:
"layouts/show_industr
y
"
,
collection:
@jobs_of_industries
,
as: :industry
%>
</div>
</div>
<div
class=
"all-industry"
>
<div
class=
"all-industry"
>
<%=
link_to
industries_path
do
%>
<%=
link_to
industries_path
do
%>
...
...
lib/src/crawler.rb
View file @
3e39495d
...
@@ -43,16 +43,22 @@ class Crawler
...
@@ -43,16 +43,22 @@ class Crawler
def
city_relationship
(
row
,
job
)
def
city_relationship
(
row
,
job
)
location_relationship
=
row
.
css
(
'div.map p a'
).
children
.
map
{
|
name_city
|
name_city
.
text
.
strip
}
location_relationship
=
row
.
css
(
'div.map p a'
).
children
.
map
{
|
name_city
|
name_city
.
text
.
strip
}
cities_relationship
=
City
.
where
(
name:
location_relationship
)
cities_relationship
=
City
.
where
(
name:
location_relationship
)
city_job_relationship
=
CityJob
.
where
(
job_id:
job
.
id
,
city_id:
cities_relationship
.
ids
)
if
city_job_relationship
.
blank?
job
.
cities
<<
cities_relationship
job
.
cities
<<
cities_relationship
end
end
end
def
industry_relationship
(
row
,
job
)
def
industry_relationship
(
row
,
job
)
industry_relationship
=
row
.
css
(
'li a'
).
children
.
map
{
|
name_industry
|
name_industry
.
text
.
strip
}
industry_relationship
=
row
.
css
(
'li a'
).
children
.
map
{
|
name_industry
|
name_industry
.
text
.
strip
}
industries_relationship
=
Industry
.
where
(
name:
industry_relationship
)
industries_relationship
=
Industry
.
where
(
name:
industry_relationship
)
industry_job_relationship
=
IndustryJob
.
where
(
job_id:
job
.
id
,
industry_id:
industries_relationship
.
ids
)
if
industry_job_relationship
.
blank?
job
.
industries
<<
industries_relationship
job
.
industries
<<
industries_relationship
end
end
end
def
create_job
(
title
,
link_page
,
row
,
company
)
def
create_job
(
title
,
link_page
,
row
,
company
)
description
=
link_page
.
search
(
'div.detail-row'
).
to_s
description
=
link_page
.
search
(
'div.detail-row'
).
to_s
...
...
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