linkfy/Tools-for-Instagram

How can I implement it in feathers.js the right way?

Closed this issue ยท 2 comments

Hey,

I would like to run the following:

require('./src/tools-for-instagram.js');
(async () => {

let user = 'username';

console.log("\n1 -- LOGIN --\n".bold.underline);
let ig = await login();

console.log("\n2 -- Get User Info -- \n".bold.underline);
let info = await getUserInfo(ig, user);
console.log("User information, username: " + info.username);

console.log("\n3 -- Get Followers in .json file -- \n".bold.underline);
//console.log("You can specify a max of iterations, like getFollowers(ig, Instargram, iterations = 2)\nEach iteration gets around 10.000 accounts".yellow);
await getFollowers(ig, user);

console.log("\n3 -- Get Following in .json file -- \n".bold.underline);
//console.log("You can specify a max of iterations, like getFollowers(ig, Instargram, iterations = 2)\nEach iteration gets around 10.000 accounts".yellow);
await getFollowing(ig, user);

console.log("\nProcess done!\n".green);

// If ONLINE_MODE is enabled, this example will run until we send an exit signal
process.exit();

})();

This is basically working in a separate file like the example.js when I type in: node follower.js
However, I would rather implement it in my index.js instead. There I already have a few other methods and after they run I would then like to examine the followers.

So I added it to my index.js in feathers. But when I then start the server with npm run dev, only the following happens in the terminal:

Tools for instagram by @linkfy
cpu backend was already registered. Reusing existing backend factory.
Platform node has already been set. Overwriting the platform with [object Object].
Not using proxy
Mobile/Residential proxy recommended
Trying to log with myaccount
info: Feathers application started on http://localhost:3030
Cookies loaded
[nodemon] restarting due to changes...
[nodemon] starting node src/

It just restarts all the time without dropping the followers in the output. Any idea?

Looks like nodemon is detecting changes, maybe the creation of the new file? And then it restarts, can you write any rule to ignore changes on output folders?