Commit 5f5bda65 by Ngô Trung Hưng

crontab

parent e806339f
Pipeline #694 canceled with stages
in 0 seconds
......@@ -3,7 +3,7 @@ class HomeController < ApplicationController
def index
@industries = Industry.sort_asc.all
@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
@top_city = City.top_hot.take(11)
@top_industry = Industry.top_hot.take(11)
......
env :PATH, ENV['PATH']
every '53 13 23 7 *' do
every 3.minutes do
rake "crawler:populate"
end
......@@ -232,17 +232,6 @@ class InterfaceWeb
def self.make_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[1].each_with_index do |path,i|
break if @@stop_crawl == path
......
......@@ -3,7 +3,13 @@ require 'src/interface_web'
namespace :crawler do
task populate: :environment do
File.write('q.txt', "hello #{Time.now}")
InterfaceWeb.craw_data_cities()
InterfaceWeb.craw_data_companies()
InterfaceWeb.make_data()
end
task do: :environment do
File.write('oo.txt', "hello #{Time.now}")
end
end
hello 2020-07-23 16:57:02 +0700
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment