Mirror of watchtower
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Aaron Parecki c54b7430c6
add cleanup task
2 years ago
controllers add additional munin stat for tracking polling rate 3 years ago
data check for web page similarity rather than using a strict hash comparison 3 years ago
jobs prevent queuing polls when one is already pending 2 years ago
lib add first munin route for tracking feeds per tier 3 years ago
public add additional munin stat for tracking polling rate 3 years ago
schema prevent queuing polls when one is already pending 2 years ago
scripts add cleanup task 2 years ago
views refactor to use league/route and league/plates 4 years ago
.gitignore add readme/composer/license 4 years ago
CONTRIBUTING.md add readme/composer/license 4 years ago
LICENSE add readme/composer/license 4 years ago
README.md switch to string match on page contents 3 years ago
composer.json deliver to subscribers 4 years ago
composer.lock deliver to subscribers 4 years ago

README.md

Watchtower

Watchtower is a minimal API that watches web pages for changes and notifies subscribers. Its API is similar to WebSub, as well as Superfeedr subscriptions.

For HTML pages, Watchtower compares the text content with all tags removed in order to determine whether a page has changed. This prevents things like CSRF tokens from triggering a change event and redelivery of the page. For all other content types, the raw content is used to compare changes.

API

Every API request requires authenticating with an application API key included as a Bearer Token.

POST / HTTP/1.1
Authorization: Bearer xxxxxxxxxx

Subscribing

To subscribe to changes of a URL, send a POST request to the root URL with the following parameters

POST https://watchtower.example/

  • hub.mode = subscribe
  • hub.topic the URL that you want to watch
  • hub.callback the subscriber's URL to be notified of changes

Unlike WebSub, Watchtower does not make an initial verification request to check the callback URL. It assumes it's valid since the API request must also include the API key.

Watchtower will create the subscription, then deliver the current contents of the URL to the subscriber. This happens asynchronously so it may take a few seconds after the API request.

Unsubscribing

To unsubscribe, send a POST request with the following parameters

POST https://watchtower.example/

  • hub.mode = unsubscribe
  • hub.topic the URL that you want to watch
  • hub.callback the subscriber's URL to be notified of changes

The subscription will be deactivated immediately.

Web Hooks

When Watchtower delivers a notification to the subscriber, it makes an HTTP POST with a content type header matching the content type of the topic, and the body of the POST is the full contents of the URL. It also includes an Authorization header with the API key, so that you can verify the authenticity of the API request.