Giter Club home page Giter Club logo

Comments (6)

thp avatar thp commented on June 30, 2024 1

The next version will have two additional filters that will help here:

  • sha1sum - Takes the retrieved content and returns the sha1sum as hexdigest
  • hexdump - Takes the retrieve content and returns a hexdump-like representation

The hexdump output doesn't include file offsets, as otherwise the diffs will be quite large.

from urlwatch.

thp avatar thp commented on June 30, 2024

You can do this for local files by just piping it into sha1sum or a similar tool or even hexdump if you want to see which bytes change. For things like PDF you can also pipe it through a tool that converts the PDF to text, so you can even see text changes.

from urlwatch.

e-dschungel avatar e-dschungel commented on June 30, 2024

Is there a way for remote files, too? This would my use case.

from urlwatch.

brbsix avatar brbsix commented on June 30, 2024

This is probably a bad idea for a number of reasons, but perhaps something like the following would work for your particular use case?

curl -Is URL | awk '$1 ~ /Last-Modified:/ {sub(".*: ", ""); print}'

from urlwatch.

e-dschungel avatar e-dschungel commented on June 30, 2024

@thp Thanks, sha1sum solves my usecase perfectly.

from urlwatch.

thp avatar thp commented on June 30, 2024

Note that this will still download the file every time fully when watched. A more efficient solution would be to only do a HEAD request and then use either ETag or Last-Modified as suggested by @brbsix, but we do not have that feature (getting HTTP headers) yet. We do already support specifying the HTTP method, so maybe if it's HEAD, the content should be the raw headers, since the body will always be empty, anyway.

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.