This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

update

+7 -5
+7 -5
src/index.ts
··· 14 14 15 15 // Main function for generating and posting wolf noise strings 16 16 async function main() { 17 + console.log("Main function called."); 18 + 17 19 // Check for empty environment variables and abort if needed 18 20 if (!process.env.BLUESKY_USERNAME || !process.env.BLUESKY_PASSWORD) { 19 21 console.error( ··· 28 30 identifier: process.env.BLUESKY_USERNAME!, 29 31 password: process.env.BLUESKY_PASSWORD!, 30 32 }); 33 + console.log("Logged in to Bluesky."); 31 34 32 35 // Generate a random wolf noise string 33 36 let randomNoise; ··· 51 54 // You can optionally implement retry logic or notify someone here 52 55 } 53 56 } 54 - 55 - // Run the main function immediately 56 - main(); 57 57 58 58 // Function to generate a random delay before the next post 59 59 function getRandomDelay() { ··· 76 76 const scheduleExpression = "0 * * * *"; // Every hour (used as a base for randomisation) 77 77 78 78 const job = new CronJob(scheduleExpression, async () => { 79 + console.log("Cron job triggered."); 79 80 // Calculate a random delay before running the main function 80 81 const delay = getRandomDelay(); 81 82 console.log(`Next post scheduled in approximately ${(delay / 3600).toFixed(2)} hours.`); ··· 84 85 await new Promise((resolve) => setTimeout(resolve, delay * 1000)); 85 86 86 87 // Run the main function 87 - main(); 88 + await main(); // Ensure to await the main function 88 89 }); 89 90 90 91 // Start the cron job 91 - job.start(); 92 + console.log("Starting the cron job."); 93 + job.start();