Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to run scraperjs through php cron? #68

Open
goranefbl opened this issue Jan 27, 2017 · 3 comments
Open

Is it possible to run scraperjs through php cron? #68

goranefbl opened this issue Jan 27, 2017 · 3 comments

Comments

@goranefbl
Copy link

So i wrote a script thats working great on node, but I am looking into pushing it to a hosting where backend is PHP. Every day, cron would run a scraper script and get some data.

Can you point me to a direction where i could get more info on how to do this, and if its even possible.

Thanks for great script.

@ruipgil
Copy link
Owner

ruipgil commented Jan 27, 2017 via email

@rafasashi
Copy link

Hello ruipgil,

I am also interested in running the dynamic scraper from php in production (for different urls and different users).

I could use exec() to start it with a command line but I have 2 problems from there:

1 - send the data in real time to a url containing Jquery (http://exqmple.com/my_widget.js)
2 - handle the end of the process once the user leave my_widget

You mentioned "have access to phantomjs" in your previous answer, what do you mean by that?

Can I do [1] and [2] with scraperjs only or do I need another script like socket?

Thanks in advance!

@rafasashi
Copy link

Hello again,

I have tried multiple things including detaching the process with screen command but now I am considering using a chat with socket.io here and run the dynamic scraper inside. This will allow me to easily handle the end of the process i guess...

When the chat session is over the dynamic scraper should be ended.

For the moment it is just on paper, do you think it is a better approach?

How can I end the dynamic scraper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants