INNER CODE UNIT · TypeScript
msWithDev
mifi/instauto · src/index.ts:329
let msWithDev = ((Math.random() * deviation) + 1) * ms;
if (dryRun) msWithDev = Math.min(3000, msWithDev); // for dryRun, no need to wait so long
logger.log('Waiting', (msWithDev / 1000).toFixed(2), 'sec');
return sleepFixed(msWithDev);
};
async function onImageLiked({ username, href }: { username: string; href: string }) {
await addLikedPhoto({ username, href, time: Date.now() });
}
function getNumFollowedUsersThisTimeUnit(timeUnit: number) {
const now = Date.now();
return getPrevFollowedUsers().filter((u) => now - u.time < timeUnit).length
+ getPrevUnfollowedUsers().filter((u) => !u.noActionTaken && now - u.time < timeUnit).length;
}
async function checkReachedFollowedUserDayLimit() {