Git Product home page Git Product logo

Comments (5)

cctse avatar cctse commented on May 22, 2024 1

@asciimoo use release version to keep it in old version, master branch only for development and release version for stable in different stage, like go-redis/redis does, but this will take you more time

from colly.

asciimoo avatar asciimoo commented on May 22, 2024

@cctse I agree, but it would require API change to be effective, because glob expressions have to be compiled and we have to track manually when the AllowedDomains list changes. Perhaps we could add a SetAllowedDomainsGlobs(domainGlobs string...) error function to the Collector for this purpose.

from colly.

asciimoo avatar asciimoo commented on May 22, 2024

@cctse as an alternative solution you can use Collector.URLFilters:

c.URLFilters = []*regexp.Regexp{
	regexp.MustCompile(`^https?://[a-z]+\.httpbin\.org/`)
}

Full example: http://go-colly.org/docs/examples/url_filter/

I think this functionality covers your needs and maybe adding domain globs too would be redundant. What do you think?

from colly.

cctse avatar cctse commented on May 22, 2024

@asciimoo thanks, this can works well, I'm using glob check before visit a link in onResponse. I'm still thinking add a function like SetAllowedDomainsGlobs may be better

from colly.

asciimoo avatar asciimoo commented on May 22, 2024

It would require less boilerplate than URLFilters but the feature it provides is only a subset of URLFilters's functionality. I think it is more important to keep the API clean and small than optimizing for edge cases by adding new functions without new functionality. Feel free to reopen if you still disagree.

from colly.

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.