행위

"낙서장"의 두 판 사이의 차이

라이언의 꿀팁백과

(새 문서: const NeoKIIS_ePoster = (function() { const DEFAULT_EPOSTER = 0; const ePosters = [ {filename: "eposter_fallback.mp4", from: "", to: ""}, {filename: "20220627_20220710.mp4", from: "20220627", to: "20220710"}, {filename: "20220711_20220724.mp4", from: "20220711", to: "20220724"}, ]; getServerDate = async function() { try { const response = await fetch(location.href); const headerDate = await response.headers.get('Date'); return formatServerDate(headerDate); } catch {...)
 
1번째 줄: 1번째 줄:
const NeoKIIS_ePoster = (function() {
[https://www.netflix.com/watch/81576174?trackId=14170287&tctx=1%2C0%2Cfcc3651d-9d86-4370-8cb2-d118c3bef982-200270760%2CNES_486C701A00851B518AD422611B04C7-994911DC4F528C-9A989B9DE8_p_1678595278773%2CNES_486C701A00851B518AD422611B04C7_p_1678595278773%2C%2C%2C%2C%2CVideo%3A81519223 https://www.netflix.com/watch/81576174?trackId=14170287]
 
const DEFAULT_EPOSTER = 0;
 
const ePosters = [
 
{filename: "eposter_fallback.mp4", from: "", to: ""},
 
{filename: "20220627_20220710.mp4", from: "20220627", to: "20220710"},
 
{filename: "20220711_20220724.mp4", from: "20220711", to: "20220724"},
 
];
 
getServerDate = async function() {
 
try {
 
const response = await fetch(location.href);
 
const headerDate = await response.headers.get('Date');
 
return formatServerDate(headerDate);
 
} catch {
 
return formatServerDate(new Date());
 
}
 
};
 
formatServerDate = function(serverDate) {
 
d = new Date(serverDate);
 
year = d.getFullYear();
 
month = ("0" + (d.getMonth() + 1)).slice(-2);
 
date = d.getDate();
 
return year + month + date;
 
};
 
getTodayPoster = function(today) {
 
return ePosters.filter(it => it.from <= today && [[it.to]] >= today).shift() || ePosters[DEFAULT_EPOSTER];
 
};
 
return {
 
init: getServerDate,
 
getTodayPoster: getTodayPoster,
 
}
 
}());
 
const today = await NeoKIIS_ePoster.init();
 
const ePoster = NeoKIIS_ePoster.getTodayPoster(today);

2023년 3월 12일 (일) 13:30 판