Git Product home page Git Product logo

Comments (5)

ItzBlitz98 avatar ItzBlitz98 commented on May 29, 2024

Unfortunately no this isn't built to be a module.

Not sure if this is what you wanted but you probably could modify the spawn command to do something else like launch an actual torrent client if you strip out the peerflix arguments.

from torrentflix.

ItzBlitz98 avatar ItzBlitz98 commented on May 29, 2024

Will close this if you have any other questions feel free to post them here.

from torrentflix.

leshow avatar leshow commented on May 29, 2024

I actually do have one question, I've forked your library because there is no other decent node modules which have good torrent site search result scrapers, I plan to execute the torrent searches in a loop and save the resulting torrent files after the user has selected them (I'm pulling data on music releases and want to allow the user to select a tracker, then select a torrent for each release; the search terms are created dynamically, however).

I noticed however that when the prompt/inquirer code is put in a loop, node's execution doesn't halt on the response... but rather it continues pushing the prompt question after question to the console without waiting for user input.

Do you have a recommendation for how I can have the inquirer actually wait for user input, so that each prompt can be executed sequentially in some kind of dynamically created loop?

from torrentflix.

ItzBlitz98 avatar ItzBlitz98 commented on May 29, 2024

Yea i ran into the same problem when building this, Its because node works asynchronously.

There are a few ways around this there is a module called async you can use and wait for a callback before running the next task you want to do:

https://github.com/caolan/async#seriestasks-callback

So for example you can do [task] [task] [task] [prompt]

I'm also using promises for the actual scraping. http://howtonode.org/promises.
Once i have grabbed everything from the torrent site i send a promise response with an object of all the data that the main script is waiting for and then handles.

If you need a guide or a basic how two i'm happy to write one up for you.

from torrentflix.

leshow avatar leshow commented on May 29, 2024

This is great, thanks for pointing me in the right direction. Let you know
how it goes.

On 7 May 2015 at 10:16, Declan [email protected] wrote:

Yea i ran into the same problem when building this, Its because node works
asynchronously.

There are a few ways around this there is a module called async you can
use and wait for a callback before running the next task you want to do:

https://github.com/caolan/async#seriestasks-callback

So for example you can do [task] [task] [task] [prompt]

I'm also using promises for the actual scraping.
http://howtonode.org/promises.
Once i have grabbed everything from the torrent site i send a promise
response with an object of all the data that the main script is waiting for
and then handles.

If you need a guide or a basic how two i'm happy to write one up for you.

β€”
Reply to this email directly or view it on GitHub
#15 (comment)
.

Evan Cameron

from torrentflix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.