From 5bd0e796252ccbbefd2734e95a38ec2a9f06924f Mon Sep 17 00:00:00 2001 From: spen Date: Mon, 22 Dec 2014 15:38:36 +0800 Subject: [PATCH] update sync account --- .../admin/import_data_controller.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index d9c75d1..5a2a6fd 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -80,7 +80,7 @@ class Admin::ImportDataController < OrbitBackendController # if hash.ntu_seq.present? if hash.user_id.present? # ntu_seq = hash.ntu_seq - u_account = hash.user_id + u_account = hash.email.split('@')[0] books_xml = Nokogiri::XML( \ # open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}")) open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}")) @@ -132,7 +132,7 @@ class Admin::ImportDataController < OrbitBackendController # if hash.ntu_seq.present? if hash.user_id.present? # ntu_seq = hash.ntu_seq - u_account = hash.user_id + u_account = hash.email.split('@')[0] conference_xml = Nokogiri::XML( \ # open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C")) open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C")) @@ -206,7 +206,7 @@ class Admin::ImportDataController < OrbitBackendController # if hash.ntu_seq.present? if hash.user_id.present? # ntu_seq = hash.ntu_seq - u_account = hash.user_id + u_account = hash.email.split('@')[0] paper_xml = Nokogiri::XML( \ #open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml")) # open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J")) @@ -278,7 +278,7 @@ def sync_conference_data # if @user.sid.present? if @user.user_id.present? # ntu_seq = @user.sid - u_account = @user.user_id + u_account = @user.email.split('@')[0] conference_xml = Nokogiri::XML( \ # open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C")) open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=paper&account=#{u_account}&type=C")) @@ -355,7 +355,7 @@ def sync_conference_data # if @user.sid.present? if @user.user_id.present? # ntu_seq = @user.sid - u_account = @user.user_id + u_account = @user.email.split('@')[0] paper_xml = Nokogiri::XML( \ #open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml")) # open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J")) @@ -436,7 +436,7 @@ def sync_book_data # if @user.sid.present? if @user.user_id.present? # ntu_seq = @user.sid - u_account = @user.user_id + u_account = @user.email.split('@')[0] books_xml = Nokogiri::XML( \ # open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}")) open("http://ann.cc.ntu.edu.tw/Achv/xmlData_useMail.asp?item=Book&account=#{u_account}")) @@ -486,7 +486,7 @@ end @user.each do |user| if user.user_id.present? next if !user.email.include? "ntu.edu.tw" - u_account = user.user_id + u_account = user.email.split('@')[0] @conference_xml = nil begin timeout(60) do @@ -559,7 +559,7 @@ def sync_journal_paper_data_auto @user.each do |user| if user.user_id.present? next if !user.email.include? "ntu.edu.tw" - u_account = user.user_id + u_account = user.email.split('@')[0] @paper_xml = nil begin timeout(60) do @@ -638,7 +638,7 @@ def sync_book_data_auto @user.each do |user| if user.user_id.present? next if !user.email.include? "ntu.edu.tw" - u_account = user.user_id + u_account = user.email.split('@')[0] @books_xml = nil begin timeout(60) do