mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-11-15 05:56:10 +00:00
Compare commits
1 Commits
0.50.40
...
api-new-wa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3851e5c9f |
@@ -96,7 +96,10 @@ def build_watch_json_schema(d):
|
|||||||
"enum": ["html_requests", "html_webdriver"]
|
"enum": ["html_requests", "html_webdriver"]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
schema['properties']['processor'] = {"anyOf": [
|
||||||
|
{"type": "string", "enum": ["restock_diff", "text_json_diff"]},
|
||||||
|
{"type": "null"}
|
||||||
|
]}
|
||||||
|
|
||||||
# All headers must be key/value type dict
|
# All headers must be key/value type dict
|
||||||
schema['properties']['headers'] = {
|
schema['properties']['headers'] = {
|
||||||
|
|||||||
@@ -228,6 +228,11 @@ components:
|
|||||||
maxLength: 5000
|
maxLength: 5000
|
||||||
required: [operation, selector, optional_value]
|
required: [operation, selector, optional_value]
|
||||||
description: Browser automation steps
|
description: Browser automation steps
|
||||||
|
processor:
|
||||||
|
type: string
|
||||||
|
enum: [restock_diff, text_json_diff]
|
||||||
|
default: text_json_diff
|
||||||
|
description: Optional processor mode to use for change detection. Defaults to `text_json_diff` if not specified.
|
||||||
|
|
||||||
Watch:
|
Watch:
|
||||||
allOf:
|
allOf:
|
||||||
@@ -428,7 +433,7 @@ paths:
|
|||||||
operationId: createWatch
|
operationId: createWatch
|
||||||
tags: [Watch Management]
|
tags: [Watch Management]
|
||||||
summary: Create a new watch
|
summary: Create a new watch
|
||||||
description: Create a single web page change monitor (watch). Requires at least 'url' to be set.
|
description: Create a single web page change monitor (watch). Requires at least 'url' to be set, Optionally use `"processor"` field to set the `restock_diff` mode or `text_json_diff` (default)
|
||||||
x-code-samples:
|
x-code-samples:
|
||||||
- lang: 'curl'
|
- lang: 'curl'
|
||||||
source: |
|
source: |
|
||||||
@@ -446,7 +451,7 @@ paths:
|
|||||||
source: |
|
source: |
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'x-api-key': 'YOUR_API_KEY',
|
'x-api-key': 'YOUR_API_KEY',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -458,7 +463,7 @@ paths:
|
|||||||
'hours': 1
|
'hours': 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response = requests.post('http://localhost:5000/api/v1/watch',
|
response = requests.post('http://localhost:5000/api/v1/watch',
|
||||||
headers=headers, json=data)
|
headers=headers, json=data)
|
||||||
print(response.text)
|
print(response.text)
|
||||||
requestBody:
|
requestBody:
|
||||||
|
|||||||
Reference in New Issue
Block a user