{"id":110,"date":"2024-04-11T23:10:00","date_gmt":"2024-04-11T15:10:00","guid":{"rendered":"https:\/\/blog.rensr.site\/?p=110"},"modified":"2024-06-21T23:21:14","modified_gmt":"2024-06-21T15:21:14","slug":"%e5%b0%8f%e7%88%b1%e8%af%be%e8%a1%a8-%e6%b7%ae%e5%8d%97%e8%81%94%e5%90%88%e5%a4%a7%e5%ad%a6%e9%80%82%e9%85%8d","status":"publish","type":"post","link":"https:\/\/blog.rensr.site\/index.php\/2024\/04\/11\/%e5%b0%8f%e7%88%b1%e8%af%be%e8%a1%a8-%e6%b7%ae%e5%8d%97%e8%81%94%e5%90%88%e5%a4%a7%e5%ad%a6%e9%80%82%e9%85%8d\/","title":{"rendered":"\u5c0f\u7231\u8bfe\u8868\u2014\u2014\u6dee\u5357\u8054\u5408\u5927\u5b66\u9002\u914d"},"content":{"rendered":"\n<p>\u5c0f\u7231\u8bfe\u7a0b\u8868APP\u662f\u5c0f\u7c73\u5c0f\u7231\u540c\u5b66\u65d7\u4e0b\u63a8\u51fa\u7684\u624b\u673a\u8bfe\u8868\u5e94\u7528\uff0c\u9996\u6b21\u91c7\u7528AI\u6280\u672f\uff0c\u8d4b\u4e88\u8bfe\u7a0b\u8868\u667a\u80fd\u4f53\u5f81\u3002\u9ad8\u989c\u503c\u3001\u64cd\u4f5c\u65b9\u4fbf\u662f\u5c0f\u7231\u8bfe\u7a0b\u8868\u7684\u91cd\u8981\u7279\u5f81\uff0c\u4f60\u53ea\u9700\u8981\u901a\u8fc7\u624b\u673a\u62cd\u7167\uff0c\u5c31\u80fd\u5c06\u7eb8\u8d28\u7684\u8bfe\u7a0b\u8868\u5feb\u901f\u5230\u5bfc\u5165\u5230\u5c0f\u7231\u4e2d\uff0c\u65e0\u8bba\u662f\u8001\u5e08\u8fd8\u662f\u5b66\u751f\u90fd\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u8bfe\u8868\uff0c\u6240\u6709\u8bfe\u7a0b\u4fe1\u606f\u4e00\u76ee\u4e86\u7136\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/blog.rensr.site\/wp-content\/uploads\/2024\/06\/image.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"500\" data-original=\"https:\/\/blog.rensr.site\/wp-content\/uploads\/2024\/06\/image.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-111\"  sizes=\"auto, (max-width: 281px) 100vw, 281px\" \/><\/div><\/figure><\/div>\n\n\n<p>\u3010\u529f\u80fd\u4ecb\u7ecd\u3011<\/p>\n\n\n\n<p>       \u3010\u62cd\u7167\u5bfc\u5165\u8bfe\u8868\u3011\uff1a\u70b9\u5f00\u201c\u62cd\u7167\u5bfc\u5165\u201d\u626b\u4e00\u626b\u8bfe\u7a0b\u8868\uff0c\u5373\u53ef\u5feb\u901f\u81ea\u52a8\u8bc6\u522b\u8bfe\u7a0b\u540d\u79f0\u3001\u4e0a\u8bfe\u5730\u70b9\u548c\u6388\u8bfe\u6559\u5e08\uff0c\u5e76\u667a\u80fd\u7f16\u8f91\u540e\u5bfc\u5165\u624b\u673a<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u4ece\u6559\u52a1\u7cfb\u7edf\u5bfc\u5165\u8bfe\u8868\u3011\uff1a\u80fd\u5c06\u5b66\u6821\u8bfe\u8868\u7684\u8bfe\u7a0b\u540d\u79f0\u3001\u4e0a\u8bfe\u5730\u70b9\u548c\u6388\u8bfe\u6559\u5e08\u4fe1\u606f\u76f4\u63a5\u5bfc\u5165app<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u667a\u80fd\u52a8\u6001\u8868\u683c\u3011\uff1a\u6839\u636e\u8bfe\u7a0b\u591a\u5c11\uff0c\u5927\u4e2d\u5b66\u751f\u4e0d\u540c\u60c5\u51b5\u52a8\u6001\u54cd\u5e94<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u5206\u4eab\u5bfc\u5165\u8bfe\u8868\u3011\uff1a\u4e00\u4eba\u7f16\u8f91\uff0c\u5168\u73ed\u5206\u4eab\uff0c\u70b9\u5f00\u540c\u5b66\u5206\u4eab\u7684\u94fe\u63a5\u5373\u53ef\u5bfc\u5165\u8bfe\u7a0b\u8868<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u8bfe\u7a0b\u63d0\u9192\u3011\uff1a\u4e00\u952e\u8bbe\u7f6e\u8bfe\u7a0b\u95f9\u949f\uff0c\u667a\u80fd\u63d0\u9192\u7528\u6237\u4e0a\u8bfe\u65f6\u95f4<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u8f7b\u677e\u7f16\u8f91\u8bfe\u7a0b\u4fe1\u606f\u3011\uff1a\u4e30\u5bcc\u81ea\u5b9a\u4e49\uff0c\u5355\u8282\u8bfe\u65f6\u957f\u3001\u8bfe\u7a0b\u8282\u6570\u5747\u53ef\u81ea\u5b9a\u4e49\uff0c\u4fee\u6539\u540e\u5c0f\u7231\u8bfe\u7a0b\u8868\u5c06\u667a\u80fd\u63a8\u7b97\u4e00\u5929\u5b89\u6392<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u4e2a\u6027\u5316\u8bbe\u7f6e\u3011\u652f\u6301\u81ea\u5b9a\u4e49\u8bfe\u7a0b\u989c\u8272<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u8bfe\u7a0b\u8868\u6570\u636e\u4e91\u540c\u6b65\u3011\uff1a\u6570\u636e\u7ed1\u5b9a\u5c0f\u7c73\u8d26\u53f7\u540e\u5373\u53ef\u652f\u6301\u8de8\u8bbe\u5907\u67e5\u8be2\uff0c\u53ef\u540c\u6b65\u5230\u5c0f\u7231\u97f3\u7bb1\u3001\u5c0f\u7231\u540c\u5b66\u8bed\u97f3\u52a9\u624b<\/p>\n\n\n\n<p>\u3000\u3000\u3010\u8bfe\u7a0b\u8868\u5206\u4eab\u3011\uff1a\u652f\u6301\u5c06\u8bfe\u7a0b\u901a\u8fc7\u94fe\u63a5\u5206\u4eab\u7ed9\u4ed6\u4eba<\/p>\n\n\n\n<p>\u4f46\u662f\u8fd9\u4e48\u597d\u7528\u7684\u8bfe\u7a0b\u8868\u8f6f\u4ef6\u5c45\u7136\u6ca1\u6709\u9002\u914d\u6211\u7684\u5b66\u6821\uff0c\u4e8e\u662f\u5fc3\u8840\u6765\u6f6e\u505a\u4e86\u6dee\u5357\u8054\u5408\u5927\u5b66\u7684\u6559\u52a1\u7cfb\u7edf\u9002\u914d\uff1a<\/p>\n\n\n\n<p>\u3010scheduleHtmlProvider.js\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function scheduleHtmlProvider(iframeContent = \"\", frameContent = \"\", dom = document) {\n\t\/\/ \u4ee5\u4e0b\u53ef\u7f16\u8f91\n\tconst ifrs = dom.getElementsByTagName(\"iframe\");\n\tconst frs = dom.getElementsByTagName(\"frame\");\n\n\tif (ifrs.length) {\n\t\tfor (let i = 0; i &lt; ifrs.length; i++) {\n\t\t\tconst dom = ifrs&#91;i].contentDocument.body.parentElement;\n\t\t\tiframeContent += scheduleHtmlProvider(\"\", \"\", dom); \/\/ \u9012\u5f52\u8c03\u7528\u65f6\u4f20\u9012\u7a7a\u5b57\u7b26\u4e32\n\t\t}\n\t}\n\n\tif (frs.length) {\n\t\tfor (let i = 0; i &lt; frs.length; i++) {\n\t\t\tconst dom = frs&#91;i].contentDocument.body.parentElement;\n\t\t\tframeContent += scheduleHtmlProvider(\"\", \"\", dom); \/\/ \u9012\u5f52\u8c03\u7528\u65f6\u4f20\u9012\u7a7a\u5b57\u7b26\u4e32\n\t\t}\n\t}\n\n\tif (!ifrs.length &amp;&amp; !frs.length) {\n\t\tconst tables = dom.querySelectorAll('table');\n\t\ttables.forEach(table => {\n\t\t\tframeContent += table.outerHTML;\n\t\t});\n\t}\n\n\tif (dom === document) {\n\t\treturn frameContent + iframeContent; \/\/ \u5728\u6700\u5916\u5c42\u6587\u6863\u4e2d\u5408\u5e76\u5185\u5bb9\n\t}\n\n\treturn iframeContent + frameContent; \/\/ \u5728\u9012\u5f52\u8c03\u7528\u4e2d\u5408\u5e76\u5185\u5bb9\n}<\/code><\/pre>\n\n\n\n<p>\u3010scheduleHtmlParser.js\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function scheduleHtmlParser(html) {\n\tfunction parseWeeks(weeksStr) {\n\t\tlet weeks = &#91;];\n\t\tlet pattern = \/(\\d+)-?(\\d*)\/g;\n\t\tlet match = pattern.exec(weeksStr);\n\t\twhile (match != null) {\n\t\t\tlet start = Math.max(1, parseInt(match&#91;1])); \/\/ \u786e\u4fdd\u5f00\u59cb\u5468\u6570\u4e0d\u5c0f\u4e8e 1\n\t\t\tlet end = match&#91;2] !== '' ? Math.min(30, parseInt(match&#91;2])) : start; \/\/ \u5982\u679c\u6ca1\u6709\u7ed3\u675f\u5468\u6570\uff0c\u5219\u7ed3\u675f\u5468\u6570\u4e3a\u5f00\u59cb\u5468\u6570\n\t\t\tfor (let i = start; i &lt;= end; i++) {\n\t\t\t\tweeks.push(i);\n\t\t\t}\n\t\t\tmatch = pattern.exec(weeksStr);\n\t\t}\n\t\treturn weeks;\n\t}\n\n\tfunction parseDay(dayStr) {\n\t\tlet dayMap = {\n\t\t\t'\u4e00': 1,\n\t\t\t'\u4e8c': 2,\n\t\t\t'\u4e09': 3,\n\t\t\t'\u56db': 4,\n\t\t\t'\u4e94': 5,\n\t\t\t'\u516d': 6,\n\t\t\t'\u65e5': 7\n\t\t};\n\t\treturn dayMap&#91;dayStr];\n\t}\n\n\tfunction parseSections(sectionsStr) {\n\t\tlet sections = &#91;];\n\t\tlet pattern = \/(\\d+)-(\\d+)\/g;\n\t\tlet match = pattern.exec(sectionsStr);\n\t\twhile (match != null) {\n\t\t\tlet start = Math.max(1, parseInt(match&#91;1])); \/\/ \u786e\u4fdd\u5f00\u59cb\u8282\u6b21\u4e0d\u5c0f\u4e8e 1\n\t\t\tlet end = Math.min(30, parseInt(match&#91;2])); \/\/ \u786e\u4fdd\u7ed3\u675f\u8282\u6b21\u4e0d\u8d85\u8fc7 30\n\t\t\tfor (let i = start; i &lt;= end; i++) {\n\t\t\t\tsections.push(i);\n\t\t\t}\n\t\t\tmatch = pattern.exec(sectionsStr);\n\t\t}\n\t\treturn sections;\n\t}\n\n\tlet result = &#91;];\n\tlet table = $(html).find('table tbody tr');\n\tfor (let i = 0; i &lt; table.length; i++) {\n\t\tlet row = table&#91;i];\n\t\tlet courseName = $(row).find('td:eq(4)').text().replace(\/\\&#91;.*?\\]\/g, '').trim();\n\t\tlet position = $(row).find('td:eq(19)').text().trim();\n\t\tlet teacher = $(row).find('td:eq(13)').text().replace(\/\\&#91;.*?\\]\/g, '').trim();\n\t\tlet weeksStr = $(row).find('td:eq(16)').text().trim();\n\t\tlet weeks = parseWeeks(weeksStr);\n\t\tlet dayStr = $(row).find('td:eq(18)').text().trim().charAt(0); \/\/ \u53ea\u83b7\u53d6\u661f\u671f\u51e0\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\n\t\tlet day = parseDay(dayStr);\n\t\tlet sectionsStr = $(row).find('td:eq(18)').text().trim();\n\t\tlet sections = parseSections(sectionsStr);\n\n\t\t\/\/ \u6dfb\u52a0\u6761\u4ef6\u5224\u65ad\uff0c\u5982\u679c\u8bfe\u7a0b\u4fe1\u606f\u4e0d\u4e3a\u7a7a\uff0c\u5219\u5c06\u5176\u52a0\u5165\u7ed3\u679c\u5217\u8868\u4e2d\n\t\tif (courseName !== '' || position !== '' || teacher !== '' || weeks.length > 0 || day !== undefined || sections\n\t\t\t.length > 0) {\n\t\t\tresult.push({\n\t\t\t\tname: courseName,\n\t\t\t\tposition: position,\n\t\t\t\tteacher: teacher,\n\t\t\t\tweeks: weeks,\n\t\t\t\tday: day,\n\t\t\t\tsections: sections\n\t\t\t});\n\t\t}\n\t}\n\treturn result;\n}<\/code><\/pre>\n\n\n\n<p>\u3010scheduleTimer.js\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>async function scheduleTimer({\n\tproviderRes,\n\tparserRes\n} = {}) {\n\treturn {\n\t\ttotalWeek: 18, \/\/ \u603b\u5468\u6570\uff1a&#91;1, 30]\u4e4b\u95f4\u7684\u6574\u6570\n\t\tstartSemester: '', \/\/ \u5f00\u5b66\u65f6\u95f4\uff1a\u65f6\u95f4\u6233\uff0c13\u4f4d\u957f\u5ea6\u5b57\u7b26\u4e32\uff0c\u63a8\u8350\u7528\u4ee3\u7801\u751f\u6210\n\t\tstartWithSunday: false, \/\/ \u662f\u5426\u662f\u5468\u65e5\u4e3a\u8d77\u59cb\u65e5\uff0c\u8be5\u9009\u9879\u4e3atrue\u65f6\uff0c\u4f1a\u5f00\u542f\u663e\u793a\u5468\u672b\u9009\u9879\n\t\tshowWeekend: true, \/\/ \u662f\u5426\u663e\u793a\u5468\u672b\n\t\tforenoon: 5, \/\/ \u4e0a\u5348\u8bfe\u7a0b\u8282\u6570\uff1a&#91;1, 10]\u4e4b\u95f4\u7684\u6574\u6570\n\t\tafternoon: 4, \/\/ \u4e0b\u5348\u8bfe\u7a0b\u8282\u6570\uff1a&#91;0, 10]\u4e4b\u95f4\u7684\u6574\u6570\n\t\tnight: 3, \/\/ \u665a\u95f4\u8bfe\u7a0b\u8282\u6570\uff1a&#91;0, 10]\u4e4b\u95f4\u7684\u6574\u6570\n\t\tsections: &#91;{\n\t\t\tsection: 1,\n\t\t\tstartTime: '08:00',\n\t\t\tendTime: '08:40',\n\t\t}, {\n\t\t\tsection: 2,\n\t\t\tstartTime: '08:50',\n\t\t\tendTime: '09:30',\n\t\t}, {\n\t\t\tsection: 3,\n\t\t\tstartTime: '09:40',\n\t\t\tendTime: '10:20',\n\t\t}, {\n\t\t\tsection: 4,\n\t\t\tstartTime: '10:30',\n\t\t\tendTime: '11:10',\n\t\t}, {\n\t\t\tsection: 5,\n\t\t\tstartTime: '11:20',\n\t\t\tendTime: '12:00',\n\t\t}, {\n\t\t\tsection: 6,\n\t\t\tstartTime: '14:30',\n\t\t\tendTime: '15:10',\n\t\t}, {\n\t\t\tsection: 7,\n\t\t\tstartTime: '15:20',\n\t\t\tendTime: '16:00',\n\t\t}, {\n\t\t\tsection: 8,\n\t\t\tstartTime: '16:10',\n\t\t\tendTime: '16:50',\n\t\t}, {\n\t\t\tsection: 9,\n\t\t\tstartTime: '17:00',\n\t\t\tendTime: '17:40',\n\t\t}, {\n\t\t\tsection: 10,\n\t\t\tstartTime: '19:00',\n\t\t\tendTime: '19:40',\n\t\t}, {\n\t\t\tsection: 11,\n\t\t\tstartTime: '19:50',\n\t\t\tendTime: '20:30',\n\t\t}, {\n\t\t\tsection: 12,\n\t\t\tstartTime: '20:40',\n\t\t\tendTime: '21:20',\n\t\t}],\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u7231\u8bfe\u7a0b\u8868APP\u662f\u5c0f\u7c73\u5c0f\u7231\u540c\u5b66\u65d7\u4e0b\u63a8\u51fa\u7684\u624b\u673a\u8bfe\u8868\u5e94\u7528\uff0c\u9996\u6b21\u91c7\u7528AI\u6280\u672f\uff0c\u8d4b\u4e88\u8bfe\u7a0b\u8868\u667a\u80fd\u4f53\u5f81\u3002\u9ad8\u989c\u503c\u3001\u64cd\u4f5c\u65b9\u4fbf\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-my-project"],"_links":{"self":[{"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":2,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/posts\/110\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rensr.site\/index.php\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}