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 the project being maintained? #33

Closed
ricsdeol opened this issue May 19, 2024 · 3 comments
Closed

Is the project being maintained? #33

ricsdeol opened this issue May 19, 2024 · 3 comments

Comments

@ricsdeol
Copy link

Hello I am very interested in the Vessel Crawler, I found it simple and productive.
However, I have some doubts that are not in the README or more elaborate example.

bundle exec vessel new MyCrawler

How i run in PROD mode?
What would Fields or Middleware? How to use it?

Could this path lib/helpers be where I could put my classes, for example saved in a database or make a call in another api with data from the crawler ?

I can help improve this documentation with these features, but I need this initial kick to create a more complete documentation.

Thanks
Att.

@route
Copy link
Member

route commented May 20, 2024

It is! And it's actively used internally, it's just lack of time to keep the docs updated. In fact there's even more coming in this year. I'll give answers in the next comment.

@route
Copy link
Member

route commented May 21, 2024

@ricsdeol First of all I need to make new release and update the README a bit.

  1. VESSEL_ENV=prod bundle exec vessel start crawler_name
  2. Fields are used to declare types and parse values when assigning them. If you create a file for example:
Vessel::Crawler::FieldType.add(:desc) do |value|
  value.to_s.strip[0..20] + "..."
end

and then assign filed in the crawler:

field :desc, value: xpath(...)

it will be shortened to 20 chars when assignined.
3. Fields at the end are passed to middleware stack where you can transform and pass to other middlewares. Default middleware is Debug but for production you could add SendToProduction middleware that at the end will send data to given endpoint.
4. Helpers are just some services or modules that help to convert the data, you could create a class and put it there. For instance PriceHelper and so on.

@ricsdeol
Copy link
Author

Ok very cool, thanks a lot

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

2 participants