63 lines
No EOL
1.7 KiB
TypeScript
63 lines
No EOL
1.7 KiB
TypeScript
//import { Discord } from "./lib/discord";
|
|
import { CreateImage } from "./lib/image";
|
|
|
|
//const YYMMDD = new Date().toISOString().slice(0, 10).replace(/-/g, "").toString();
|
|
const YYMMDD = "20250530"
|
|
//console.log(YYMMDD);
|
|
|
|
//Discord("20250509")
|
|
async function run() {
|
|
console.time("Post");
|
|
const post = await CreateImage.PostMeal(YYMMDD);
|
|
console.timeEnd("Post");
|
|
console.log("Post created:", post);
|
|
let NutritionInfoText = "";
|
|
const entries = Object.entries(post ?? {}).filter(([_, value]) => value.toString().length > 0);
|
|
entries.forEach(([name, value], idx) => {
|
|
NutritionInfoText += `${name} : ${value.toString().replace(",", ", ")}`;
|
|
if (idx !== entries.length - 1) {
|
|
NutritionInfoText += "\n";
|
|
}
|
|
});
|
|
console.log("Nutrition Info Text:", NutritionInfoText);
|
|
|
|
console.time("Story");
|
|
await CreateImage.ConvertToStory(`./temp/${YYMMDD}.png`);
|
|
console.timeEnd("Story");
|
|
}
|
|
|
|
run();
|
|
|
|
import { getAllSchedules } from "./lib/schedule";
|
|
|
|
|
|
//import { CreateImage } from "./lib/image";
|
|
|
|
//CreateImage.PostSchedule()
|
|
|
|
//const tomorrow = new Date();
|
|
//tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
|
// 내일이 1일이면
|
|
//console.log(tomorrow.getDate());
|
|
|
|
|
|
/*import { VTSList } from "./lib/vts";
|
|
|
|
VTSList().then(results => {
|
|
if (results.length > 0) {
|
|
console.log("\n5번째 행의 노란색 셀 내용 리스트:");
|
|
results.forEach(value => console.log(value));
|
|
} else {
|
|
console.log("\n5번째 행에서 노란색 배경의 셀을 찾지 못했거나, 'V.T.S.' 조건 불충족.");
|
|
}
|
|
});*/
|
|
/*
|
|
getAllSchedules()
|
|
.then((schedules) => {
|
|
console.log("학사 일정:", schedules);
|
|
})
|
|
.catch((error) => {
|
|
console.error("Error fetching schedules:", error);
|
|
});
|
|
*/ |