Giter Club home page Giter Club logo

Comments (2)

thp avatar thp commented on July 17, 2024

One quick and pragmatic way to do this would be to write a small script that generates the urls.yaml from a "template" that you specified like above. This way, you can make it as complex and/or powerful as you want.

The suggestion you had doesn't properly work if e.g. you want to give different URLs different names or something. On the other hand, for this simple case of turning the "url" field into a list, it could work. The job parser needs to be updated to deal with that properly, though (probably the job parser would go and "expand" the data accordingly, so that practically the rest of the codebase "sees" distinct jobs that just happen to have the same filter configuration).

Keeping this open for now as feature idea for the future.

from urlwatch.

trevorshannon avatar trevorshannon commented on July 17, 2024

Perhaps this will help @jwilk or others searching for a solution.

I generally use the global job_defaults to apply the same filters to all my URLs (docs). If I have a few URLs that need an additional filter step or perhaps a few URLs that need a certain filter step skipped, I use a custom SelectiveFilter. This is obviously just for my use case, but perhaps the idea can be generalized.

This custom SelectiveFilter allows you to define a list of regex patterns to match. A defined conventional filter is then applied selectively depending on the results of that match.

Not exactly what you want, but I think the concept of making a custom filter in your hooks.py and giving that filter some logic to either apply itself or not is a workable solution.

from urlwatch.

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.