Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
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 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Thanh Hung Pham
  • veNJOB
  • Merge Requests
  • !1

Merged
Opened Jun 28, 2017 by Thanh Hung Pham@hungpt 
  • Report abuse
Report abuse

Feature crawler data

Crawler data and import to database.

  • Discussion 19
  • Commits 12
  • Changes 57
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 0cef5747 - Fix css to xpath, and validates model

    Compare with previous version

    Jun 29, 2017

    added 1 commit

    • 0cef5747 - Fix css to xpath, and validates model

    Compare with previous version

    added 1 commit * 0cef5747 - Fix css to xpath, and validates model [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3389&start_sha=ee42f3407f61d70347df051a649440eead3a9415)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • d6fa267c - fig bug: convert string to date

    Compare with previous version

    Jun 29, 2017

    added 1 commit

    • d6fa267c - fig bug: convert string to date

    Compare with previous version

    added 1 commit * d6fa267c - fig bug: convert string to date [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3390&start_sha=0cef57473f55f803d4f125054bc35116b8ed6133)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 9707d2d0 - Resolve thread

    Compare with previous version

    Jun 29, 2017

    added 1 commit

    • 9707d2d0 - Resolve thread

    Compare with previous version

    added 1 commit * 9707d2d0 - Resolve thread [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3391&start_sha=d6fa267c6afa34d9e6bc200570209c15058ba41c)
    Toggle commit list
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jun 29, 2017
    Last updated by Thanh Hung Pham Jun 30, 2017
    db/migrate/20170628020034_create_applies.rb 0 → 100644
    1 class CreateApplies < ActiveRecord::Migration[5.1]
    2 def change
    3 create_table :applies do |t|
    4 t.references :user, index: true
    5 t.references :job, index: true
    6 t.datetime :applied_at
    7 t.string :ip_address
    8 t.string :user_agrent
    • Tan Phat Nguyen @phatnt commented Jun 29, 2017
      Master

      @hungpt user_agrent -> user_agent

      Edited Jul 04, 2017 by Tan Phat Nguyen
      @hungpt user_agrent -> user_agent
    • Thanh Hung Pham @hungpt

      changed this line in version 6 of the diff

      Jun 30, 2017

      changed this line in version 6 of the diff

      changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3398&start_sha=09bd6db39c7b8e2d6e7bcd4df4606c656c55e4ab#2fcf98e9e035b98dba75f44960957c75fe88bd6b_8_8)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jun 30, 2017
      Master

      @phatnt fixed user_agrent-> user_agent

      @phatnt fixed user_agrent-> user_agent
    Please register or sign in to reply
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 09bd6db3 - Resolve thread

    Compare with previous version

    Jun 29, 2017

    added 1 commit

    • 09bd6db3 - Resolve thread

    Compare with previous version

    added 1 commit * 09bd6db3 - Resolve thread [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3392&start_sha=9707d2d0d0e179c6ef989a83795b225a14f7cfed)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 128eb750 - Change user_agrent-> user_agent

    Compare with previous version

    Jun 30, 2017

    added 1 commit

    • 128eb750 - Change user_agrent-> user_agent

    Compare with previous version

    added 1 commit * 128eb750 - Change user_agrent-&gt; user_agent [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3398&start_sha=09bd6db39c7b8e2d6e7bcd4df4606c656c55e4ab)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • fa55f791 - Fix check unique Job data by name,city,company

    Compare with previous version

    Jun 30, 2017

    added 1 commit

    • fa55f791 - Fix check unique Job data by name,city,company

    Compare with previous version

    added 1 commit * fa55f791 - Fix check unique Job data by name,city,company [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3403&start_sha=128eb7508a87951d409899e3bc9d461c4ec51873)
    Toggle commit list
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    lib/tasks/careerbuilder.rb 0 → 100644
    107
    108 job_expiry_date = doc.xpath("//ul[@class='DetailJobNew']/li/p[span/text()='Hết hạn nộp: ']/text()").to_s
    109
    110 city = City.find_by_name(job_location)
    111
    112 job = Job.new
    113 job.name = job_name
    114 job.description = job_description
    115 job.salary = job_salary
    116 job.city = city
    117 job.company = company
    118 job.level = job_level
    119 job.experience = job_experience
    120 job.status = 0
    121 job.expiry_date = job_expiry_date.to_datetime
    122 job.save if Job.where(name: job_name, city: city, company: company).blank?
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt if job exist, can you update it?

      Edited Jul 04, 2017
      @hungpt if job exist, can you update it?
    • Thanh Hung Pham @hungpt

      changed this line in version 11 of the diff

      Jul 03, 2017

      changed this line in version 11 of the diff

      changed this line in [version 11 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3435&start_sha=5646d137e68d354cf21a6d1b125c717feade2a8c#b96ec562c8adbaa5478a3e0d54b12b860792f7c1_121_121)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    lib/tasks/careerbuilder.rb 0 → 100644
    115 job.salary = job_salary
    116 job.city = city
    117 job.company = company
    118 job.level = job_level
    119 job.experience = job_experience
    120 job.status = 0
    121 job.expiry_date = job_expiry_date.to_datetime
    122 job.save if Job.where(name: job_name, city: city, company: company).blank?
    123
    124 job_category.split(',').each do |category|
    125 category = Category.find_by_name(category)
    126 JobCategory.new(job: job, category: category).save if JobCategory.where(job: job, category: category).blank?
    127 end
    128 end
    129
    130 def import_area
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt Neu gia tri co dinh, thi khong can method nay, viet cai seed migrate de save vao db. Coi nhu la du lieu master

      Edited Jul 04, 2017
      @hungpt Neu gia tri co dinh, thi khong can method nay, viet cai seed migrate de save vao db. Coi nhu la du lieu master
    • Thanh Hung Pham @hungpt

      changed this line in version 8 of the diff

      Jul 03, 2017

      changed this line in version 8 of the diff

      changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3432&start_sha=fa55f791bd26a2674991152be7ea2f758a3ab945#b96ec562c8adbaa5478a3e0d54b12b860792f7c1_130_129)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    lib/tasks/careerbuilder.rb 0 → 100644
    126 JobCategory.new(job: job, category: category).save if JobCategory.where(job: job, category: category).blank?
    127 end
    128 end
    129
    130 def import_area
    131 Area.new(name: 'Viet Nam').save if Area.where(name: 'Viet Nam').blank?
    132 Area.new(name: 'International').save if Area.where(name: 'International').blank?
    133 rescue StandardError => e
    134 logger.error("[method: ] #{import_category}")
    135 logger.error(e.message)
    136 logger.error(e.backtrace)
    137 end
    138
    139 def import_category(doc)
    140 categories = doc.xpath("//div[@class='s-home2']/div[@id='NewSearchJob3']/form/div[@class='search-horizontal']/div[@class='ui-widget box_multiSelect_industry']/select/option")
    141 categories = categories.slice(1..categories.size - 2)
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt logic is difficult what use the number for?

      Edited Jul 04, 2017
      @hungpt logic is difficult what use the number for?
    • Thanh Hung Pham @hungpt

      changed this line in version 9 of the diff

      Jul 03, 2017

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3433&start_sha=e3fd63c32639731f1b5803c2ed517f27c568c037#b96ec562c8adbaa5478a3e0d54b12b860792f7c1_131_131)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    lib/tasks/careerbuilder.rb 0 → 100644
    140 categories = doc.xpath("//div[@class='s-home2']/div[@id='NewSearchJob3']/form/div[@class='search-horizontal']/div[@class='ui-widget box_multiSelect_industry']/select/option")
    141 categories = categories.slice(1..categories.size - 2)
    142 categories.each do |category|
    143 Category.new(name: category.text.strip).save if Category.where(name: category.text.strip).blank?
    144 end
    145 rescue StandardError => e
    146 logger.error("[method: ] #{import_category}")
    147 logger.error(e.message)
    148 logger.error(e.backtrace)
    149 end
    150
    151 def import_city(doc)
    152 cities = doc.xpath("//div[@class='s-home2']//div[@id='NewSearchJob3']/form/div[@class='search-horizontal']/div[@class='ui-widget box_multiSelect_location']/select/option").drop(1)
    153 area_id = 1
    154 cities.each do |city|
    155 area_id = 2 if city.text == 'Angola'
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt tai sao lai gan co dinh gia tri nay? Con so thi khong the hien duoc y nghia

      Edited Jul 04, 2017
      @hungpt tai sao lai gan co dinh gia tri nay? Con so thi khong the hien duoc y nghia
    • Thanh Hung Pham @hungpt

      changed this line in version 9 of the diff

      Jul 03, 2017

      changed this line in version 9 of the diff

      changed this line in [version 9 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3433&start_sha=e3fd63c32639731f1b5803c2ed517f27c568c037#b96ec562c8adbaa5478a3e0d54b12b860792f7c1_145_145)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 04, 2017
    lib/tasks/careerbuilder.rb 0 → 100644
    1 require 'thread'
    2 require 'open-uri'
    3 require 'nokogiri'
    4 require 'logger'
    5
    6 class Careerbuilder
    7 attr_reader :domain, :thread_count, :logger
    8
    9 def initialize(domain, thread_count = 1)
    10 @links = [url: 'http://careerbuilder.vn/viec-lam/tat-ca-viec-lam-vi.html', handler: :top] * thread_count
    11 @crawled = []
    12 @mutex = Mutex.new
    13 @domain = domain
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt cai bien nay khong thay dung` o dau?

      Edited Jul 04, 2017
      @hungpt cai bien nay khong thay dung` o dau?
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    • Thanh Hung Pham @hungpt

      changed this line in version 12 of the diff

      Jul 04, 2017

      changed this line in version 12 of the diff

      changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3437&start_sha=9604a13ff74fa80cfd8f6dc63f7c8e8dc2065f4c#b96ec562c8adbaa5478a3e0d54b12b860792f7c1_13_0)
      Toggle commit list
    Please register or sign in to reply
  • Tan Phat Nguyen
    @phatnt started a discussion on the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    db/migrate/20170628014941_create_cities.rb 0 → 100644
    1 class CreateCities < ActiveRecord::Migration[5.1]
    2 def change
    3 create_table :cities do |t|
    4 t.string :name, index: true
    5 t.references :area, index: true
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt please add index for all foreign key

      add_index :cities, :area_id

      Edited Jul 04, 2017
      @hungpt please add index for all foreign key `add_index :cities, :area_id`
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Tan Phat Nguyen @phatnt commented Jul 03, 2017
    Master

    @hungpt please add index for all foreign key, and find fields

    @hungpt please add index for all foreign key, and find fields
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 03, 2017
    config/schedule.rb 0 → 100644
    7 #
    8 # set :output, "/path/to/my/cron_log.log"
    9 #
    10 # every 2.hours do
    11 # command "/usr/bin/some_great_command"
    12 # runner "MyModel.some_method"
    13 # rake "some:great:rake:task"
    14 # end
    15 #
    16 # every 4.days do
    17 # runner "AnotherModel.prune_old_records"
    18 # end
    19
    20 # Learn more: http://github.com/javan/whenever
    21 every 1.day, at: '12:00 pm' do
    22 runner 'MyModel.task_to_run'
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt what is the real command runner?

      Edited Jul 04, 2017
      @hungpt what is the real command runner?
    • Thanh Hung Pham @hungpt

      changed this line in version 10 of the diff

      Jul 03, 2017

      changed this line in version 10 of the diff

      changed this line in [version 10 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3434&start_sha=d04c9f2fd1af896da5943bf7baf97597788b3975#c53c1220f7ae5bac862d271ba54262e1261849f2_22_26)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 03, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Thanh Hung Pham @hungpt

    added 1 commit

    • e3fd63c3 - Move import area data to db:seed

    Compare with previous version

    Jul 03, 2017

    added 1 commit

    • e3fd63c3 - Move import area data to db:seed

    Compare with previous version

    added 1 commit * e3fd63c3 - Move import area data to db:seed [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3432&start_sha=fa55f791bd26a2674991152be7ea2f758a3ab945)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • d04c9f2f - Fix import categories and cities

    Compare with previous version

    Jul 03, 2017

    added 1 commit

    • d04c9f2f - Fix import categories and cities

    Compare with previous version

    added 1 commit * d04c9f2f - Fix import categories and cities [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3433&start_sha=e3fd63c32639731f1b5803c2ed517f27c568c037)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 5646d137 - Fix variable not use and schedule content

    Compare with previous version

    Jul 03, 2017

    added 1 commit

    • 5646d137 - Fix variable not use and schedule content

    Compare with previous version

    added 1 commit * 5646d137 - Fix variable not use and schedule content [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3434&start_sha=d04c9f2fd1af896da5943bf7baf97597788b3975)
    Toggle commit list
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 9604a13f - Check data exits to update

    Compare with previous version

    Jul 03, 2017

    added 1 commit

    • 9604a13f - Check data exits to update

    Compare with previous version

    added 1 commit * 9604a13f - Check data exits to update [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3435&start_sha=5646d137e68d354cf21a6d1b125c717feade2a8c)
    Toggle commit list
  • Tan Phat Nguyen
    @phatnt started a discussion on an old version of the diff Jul 03, 2017
    Last updated by Thanh Hung Pham Jul 04, 2017
    lib/tasks/crawler.rake 0 → 100644
    1 namespace :crawler do
    2 desc 'client crawler'
    3 task load: :environment do
    4 require "#{Rails.root}/lib/tasks/careerbuilder"
    • Tan Phat Nguyen @phatnt commented Jul 03, 2017
      Master

      @hungpt you should add config/application.rb

      config.autoload_paths += %W(#{config.root}/lib)
      config.eager_load_paths += %W(#{config.root}/lib)

      So you do not require in here

      Edited Jul 04, 2017
      @hungpt you should add `config/application.rb` ``` config.autoload_paths += %W(#{config.root}/lib) config.eager_load_paths += %W(#{config.root}/lib) ``` So you do not require in here
    • Thanh Hung Pham @hungpt

      changed this line in version 12 of the diff

      Jul 04, 2017

      changed this line in version 12 of the diff

      changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3437&start_sha=9604a13ff74fa80cfd8f6dc63f7c8e8dc2065f4c#b321b772986de9dfe9db0ed4138ae166e577f241_4_4)
      Toggle commit list
    • Thanh Hung Pham @hungpt commented Jul 04, 2017
      Master

      fixed

      fixed
    Please register or sign in to reply
  • Thanh Hung Pham @hungpt

    added 1 commit

    • 478d6a95 - Config autoload

    Compare with previous version

    Jul 04, 2017

    added 1 commit

    • 478d6a95 - Config autoload

    Compare with previous version

    added 1 commit * 478d6a95 - Config autoload [Compare with previous version](https://gitlab.zigexn.vn/hungpt/veNJOB/merge_requests/1/diffs?diff_id=3437&start_sha=9604a13ff74fa80cfd8f6dc63f7c8e8dc2065f4c)
    Toggle commit list
  • Tan Phat Nguyen @phatnt

    mentioned in commit 454004db

    Jul 04, 2017

    mentioned in commit 454004db

    mentioned in commit 454004db3c11abd6b726d38d64a0a1a8ddd9d1d5
    Toggle commit list
  • Tan Phat Nguyen @phatnt

    merged

    Jul 04, 2017

    merged

    merged
    Toggle commit list
  • Write
  • Preview
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 sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: hungpt/veNJOB!1
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.