Update fgu_sync.rake.

This commit is contained in:
BoHung Chiu 2023-06-28 08:54:46 +08:00
parent 0eae8b354e
commit 2acf3030f4
1 changed files with 3 additions and 1 deletions

View File

@ -329,7 +329,9 @@ namespace :fgu_sync do
av.save
end
dt["courses"].each do |course|
course_html += "<a data-year='#{course["year"].to_i + 1911}' data-sem='#{course["sem"]}' href='#{course["course_url"]}' target='_blank'>#{course["course_id"]} #{course["course_name"]}</a><br />"
course_url = course["course_url"]
course_url.gsub!(/http:\/\/(.*\.fgu\.edu\.tw)/, 'https://\1')
course_html += "<a data-year='#{course["year"].to_i + 1911}' data-sem='#{course["sem"]}' href='#{course_url}' target='_blank'>#{course["course_id"]} #{course["course_name"]}</a><br />"
av.value= {:en => course_html, :zh_tw => course_html}
av.save
end