Simplify Threads captions and capture five minutes after sunrise
This commit is contained in:
@@ -7,7 +7,11 @@ import { THREADS } from '../../src/constants/threads.ts';
|
||||
export function dailySchedule(now: Date) {
|
||||
const sunrise = calculateSun(now, observer).sunrise;
|
||||
if (!sunrise || !Number.isFinite(+sunrise)) throw new Error('No sunrise for this date');
|
||||
return { date: kstFields(now).date, sunrise, prepareAt: new Date(+sunrise - THREADS.prepareMs) };
|
||||
return { date: kstFields(now).date, sunrise, captureAt: sunriseCaptureTime(sunrise), prepareAt: new Date(+sunrise - THREADS.prepareMs) };
|
||||
}
|
||||
|
||||
export function sunriseCaptureTime(sunrise: Date): Date {
|
||||
return new Date(+sunrise + THREADS.captureDelayMs);
|
||||
}
|
||||
|
||||
export async function threadsRequest(token: string, path: string, params: Record<string, string>, method = 'GET', request: typeof fetch = fetch) {
|
||||
|
||||
Reference in New Issue
Block a user