Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Venjob_HungNT
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
Ngô Trung Hưng
Venjob_HungNT
Commits
5f5bda65
Commit
5f5bda65
authored
Jul 23, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crontab
parent
e806339f
Pipeline
#694
canceled with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
15 deletions
+12
-15
app/controllers/home_controller.rb
+1
-1
config/schedule.rb
+3
-3
lib/src/interface_web.rb
+0
-11
lib/tasks/crawler.rake
+6
-0
q.txt
+2
-0
No files found.
app/controllers/home_controller.rb
View file @
5f5bda65
...
@@ -3,7 +3,7 @@ class HomeController < ApplicationController
...
@@ -3,7 +3,7 @@ class HomeController < ApplicationController
def
index
def
index
@industries
=
Industry
.
sort_asc
.
all
@industries
=
Industry
.
sort_asc
.
all
@job_count
=
Job
.
all
.
count
@job_count
=
Job
.
all
.
count
@five_jobs
=
Job
.
order
(
created_at: :
asc
).
where
(
newdata:
1
).
limit
(
5
)
@five_jobs
=
Job
.
order
(
created_at: :
desc
).
limit
(
5
)
@cities
=
City
.
all
@cities
=
City
.
all
@top_city
=
City
.
top_hot
.
take
(
11
)
@top_city
=
City
.
top_hot
.
take
(
11
)
@top_industry
=
Industry
.
top_hot
.
take
(
11
)
@top_industry
=
Industry
.
top_hot
.
take
(
11
)
...
...
config/schedule.rb
View file @
5f5bda65
env
:PATH
,
ENV
[
'PATH'
]
every
'53 13 23 7 *'
do
every
3
.
minutes
do
rake
"crawler:populate"
rake
"crawler:populate"
end
end
\ No newline at end of file
lib/src/interface_web.rb
View file @
5f5bda65
...
@@ -232,17 +232,6 @@ class InterfaceWeb
...
@@ -232,17 +232,6 @@ class InterfaceWeb
def
self
.
make_data
def
self
.
make_data
puts
'Please wait for crawl jobs data! . . .'
puts
'Please wait for crawl jobs data! . . .'
name
=
''
company_name
=
''
level
=
''
exprience
=
''
salary
=
''
created_date
=
''
expiration_date
=
''
description
=
''
industry_name
=
''
city_name
=
''
link_crawl
=
get_link_job_and_companies
link_crawl
=
get_link_job_and_companies
link_crawl
[
1
].
each_with_index
do
|
path
,
i
|
link_crawl
[
1
].
each_with_index
do
|
path
,
i
|
break
if
@@stop_crawl
==
path
break
if
@@stop_crawl
==
path
...
...
lib/tasks/crawler.rake
View file @
5f5bda65
...
@@ -3,7 +3,13 @@ require 'src/interface_web'
...
@@ -3,7 +3,13 @@ require 'src/interface_web'
namespace
:crawler
do
namespace
:crawler
do
task
populate: :environment
do
task
populate: :environment
do
File
.
write
(
'q.txt'
,
"hello
#{
Time
.
now
}
"
)
InterfaceWeb
.
craw_data_cities
()
InterfaceWeb
.
craw_data_companies
()
InterfaceWeb
.
craw_data_companies
()
InterfaceWeb
.
make_data
()
InterfaceWeb
.
make_data
()
end
end
task
do: :environment
do
File
.
write
(
'oo.txt'
,
"hello
#{
Time
.
now
}
"
)
end
end
end
q.txt
0 → 100644
View file @
5f5bda65
hello 2020-07-23 16:57:02 +0700
\ No newline at end of file
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