diff --git a/lib/tasks/sync_ntu_personal_data_tasks.rake b/lib/tasks/sync_ntu_personal_data_tasks.rake index eae0587..daad97b 100644 --- a/lib/tasks/sync_ntu_personal_data_tasks.rake +++ b/lib/tasks/sync_ntu_personal_data_tasks.rake @@ -86,8 +86,8 @@ module NtuSyncPlugin return res end - def self.get_sync_data_xml(ntuseq, type) - uri = URI.parse("https://my.ntu.edu.tw/achvservice/xmlpaper.asp?Seq=#{ntuseq}&type=#{type}") + def self.get_sync_data_xml(ntuseq, type, api_name="xmlpaper") + uri = URI.parse("https://my.ntu.edu.tw/achvservice/#{api_name}.asp?Seq=#{ntuseq}&type=#{type}") response = get_response(uri) return Nokogiri::XML(response.body) end @@ -204,7 +204,7 @@ module NtuSyncPlugin Book.where(member_profile_id: mp.id).destroy puts "Sync_Book:... #{u_account}." puts ntuseq - books_xml = get_sync_data_xml(ntuseq, "B") + books_xml = get_sync_data_xml(ntuseq, "B", "xmlBook") @books = books_xml.xpath("//Book").map do |book_node| { author: (book_node>"Authors").text,