cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-16 14:55:49 +09:00
parent b23cc59540
commit a35532b966

View File

@ -52,22 +52,7 @@
document.getElementById('lastUpdate').textContent = now.toLocaleString('ko-KR', options);
}
// 페이지 로드 시 초기 시간 설정
updateLastUpdateTime();
// RSS 피드를 가져올 때마다 시간 업데이트
const originalFetchRSS = fetchRSS;
fetchRSS = function () {
originalFetchRSS();
updateLastUpdateTime();
};
</script>
<div class="news-container" id="newsContainer">
<!-- RSS 피드 항목들이 여기에 동적으로 추가됩니다 -->
</div>
<script>
// fetchRSS 함수 정의
function fetchRSS() {
fetch('/RSSFeed/getITWorld')
.then(response => response.json())
@ -91,6 +76,7 @@
`;
newsContainer.appendChild(newsItem);
});
updateLastUpdateTime(); // RSS 피드를 가져온 후 시간 업데이트
})
.catch(error => console.error('RSS 피드를 가져오는 중 오류 발생:', error));
}
@ -116,12 +102,16 @@
return `${base.protocol}//${base.hostname}${base.pathname.substring(0, base.pathname.lastIndexOf('/') + 1)}${url}`;
}
// 페이지 로드 시 RSS 피드 가져오기
// 페이지 로드 시 초기 시간 설정 및 RSS 피드 가져오기
updateLastUpdateTime();
fetchRSS();
// 1시간마다 RSS 피드 업데이트
setInterval(fetchRSS, 3600000);
</script>
<div class="news-container" id="newsContainer">
<!-- RSS 피드 항목들이 여기에 동적으로 추가됩니다 -->
</div>
</div>
</div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>