-
Notifications
You must be signed in to change notification settings - Fork 1
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
Crawlers should support custom steps #17
Comments
Hey Eric, I was thinking about something more like this: var crawler = require('roach').crawler({
custom: function(){}
});
crawler
.get('http://something.io/file.zip')
.pipe(crawler.unzip())
.find('a.link')
.custom()
.done(); I think it would be better to access the crawler methods (get, zip, csv, etc) outside of the job. |
Ya that should work. Although I suspect it will look more like this: var crawler = require('roach').crawler({
custom: function(){}
});
crawler
.get('http://something.io/file.zip')
.pipe(crawler.unzip())
.pipe(crawler.find('a.link'))
.pipe(crawler.custom())
.done(); |
Yes, having a pipe api would help us to be more consistent. |
I'm going to work on this right now. |
Either use pipe or we use the jquery style |
Do you know a chainable library with pipe? |
The then is more like promise based right? |
No I don't know one that has a 'pipe' method explicitly. And ya jQuery's |
I'll figured what is the best solution, I guess using promises would be easier. |
Ya I thought it would be promise based for sure. Look at how Casper does it. It's basically what we are going to emulate. |
oki I'll. |
Could also look at how gulpjs is doing their pipe method. |
We might need our own |
Eric, do you want the crawler('http://myfile.txt')
.step(require('step1'))
.step(require('step2')); UPDATE: Having something as above is not possible because every handler return a stream. |
A crawler might look something like this.
The text was updated successfully, but these errors were encountered: