cornford-michael icon

call interval with set timeout

cornford-michael | PRO | 03/04/25 12:06:09 PM UTC | 0 ⭐ | 12431 👁️ | Never ⏰ | [react]
JavaScript |

1.6 KB

|

None

|

0 👍

/

0 👎

import React from "react";
import axios from "axios";
 
function App() {
  const apiCall = async () => {
    try {
      const ping = await axios({
        url: "https://rest.ensembl.org/info/ping?content-type=application/json",
        method: "GET",
        headers: {
          accept: "Application/json",
          "Content-Type": "Application/json",
        },
      });
      return ping.data;
    } catch (error) {
      return error.response;
    }
  };
 
  const myIntervalFunc = () => {
    let myCall = async () => await apiCall();
    let retryNum = 0;
    
    // do you need to call this here?
    // it doesn't seem like this would do anything
    myCall();
 
    // create interval as a named function
    const interval = async () => {
        let intervalCall = await myCall();
        
        // end loop if ping === 2
        if (intervalCall.ping === 2) {
          return;
        }
 
        retryNum++;
        console.log("INTERVAL DATA ", intervalCall);
        
        // you don't need to change the `===` to `>=`
        // I find this is a `safe` way to handle it
        // in case something else increments retryNum
        // beyond 6 
        if (retryNum >= 6) {
          return;
        }
 
        // run `interval` again
        setTimeout(interval, 3000);
    };
    
    // call interval
    //  https://stackoverflow.com/questions/67726138/is-there-a-way-to-fetch-data-every-second-in-nextjs-with-getserversideprops
    interval();
  };
 
  return <button onClick={() => myIntervalFunc()}>Make interval call</button>;
}
 
export default App;

Comments

  • Xorfidar icon
    03/29/26 09:56:00 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎