INNER CODE UNIT · TypeScript

throttle

mifi/instauto · src/index.ts:367

  async function throttle() {
    await checkReachedFollowedUserDayLimit();
    await checkReachedFollowedUserHourLimit();
    await checkReachedLikedUserDayLimit();
  }

  function haveRecentlyFollowedUser(username: string) {
    const followedUserEntry = getPrevFollowedUser(username);
    if (!followedUserEntry) return false; // We did not previously follow this user, so don't know
    return Date.now() - followedUserEntry.time < dontUnfollowUntilTimeElapsed;
  }

  // See https://github.com/mifi/SimpleInstaBot/issues/140#issuecomment-1149105387
  const gotoUrl = async (url: string) => page.goto(url, { waitUntil: ['load', 'domcontentloaded', 'networkidle0'] });

  async function gotoWithRetry(url: string) {
    const maxAttempts = 3;
    for (let attempt = 0; ; attempt += 1) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…