cleaning this all up a bit further...
This commit is contained in:
parent
a261e2f403
commit
5c6523d7a2
5 changed files with 4 additions and 226 deletions
|
|
@ -59,6 +59,10 @@ account:
|
||||||
|
|
||||||
to do
|
to do
|
||||||
|
|
||||||
|
### Updating a subscription
|
||||||
|
|
||||||
|
to do
|
||||||
|
|
||||||
## Random Notes
|
## Random Notes
|
||||||
|
|
||||||
- `user_id` seems to change when all subscriptions are deleted and a new one is added
|
- `user_id` seems to change when all subscriptions are deleted and a new one is added
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
"id": "{{ mysterious_id }}",
|
|
||||||
"ver": "1.24",
|
|
||||||
"lang": "deu",
|
|
||||||
"auth": {
|
|
||||||
"type": "AID",
|
|
||||||
"aid": "{{ aid }}"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"id": "HAFAS",
|
|
||||||
"type": "WEB",
|
|
||||||
"name": "webapp",
|
|
||||||
"l": "vs_webapp",
|
|
||||||
"v": 10104
|
|
||||||
},
|
|
||||||
"formatted": false,
|
|
||||||
"ext": "VRR.1",
|
|
||||||
"svcReqL": [
|
|
||||||
{
|
|
||||||
"meth": "SubscrCreate",
|
|
||||||
"req": {
|
|
||||||
"statSubscr": {
|
|
||||||
"hysteresis": {
|
|
||||||
"himFltrL": [
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"jnyFltrL": [
|
|
||||||
{
|
|
||||||
"type": "LINEID",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": 92404
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"serviceDays": {
|
|
||||||
"selectedWeekdays": "1111111",
|
|
||||||
"beginDate": "20250615",
|
|
||||||
"endDate": "20331211",
|
|
||||||
"beginTime": "000000",
|
|
||||||
"endTime": "235959"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"userId": "{{ user_id }}",
|
|
||||||
"channels": [
|
|
||||||
{
|
|
||||||
"channelId": "{{ channel_id }}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"id": "1|5|"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
{
|
|
||||||
"id": "{{ mysterious_id }}",
|
|
||||||
"ver": "1.24",
|
|
||||||
"lang": "deu",
|
|
||||||
"auth": {
|
|
||||||
"type": "AID",
|
|
||||||
"aid": "{{ aid }}"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"id": "HAFAS",
|
|
||||||
"type": "WEB",
|
|
||||||
"name": "webapp",
|
|
||||||
"l": "vs_webapp",
|
|
||||||
"v": 10104
|
|
||||||
},
|
|
||||||
"formatted": false,
|
|
||||||
"ext": "VRR.1",
|
|
||||||
"svcReqL": [
|
|
||||||
{
|
|
||||||
"meth": "SubscrUpdate",
|
|
||||||
"req": {
|
|
||||||
"userId": "{{ user_id }}",
|
|
||||||
"subscrId": {{ subscription_id }},
|
|
||||||
"statSubscr": {
|
|
||||||
"hysteresis": {
|
|
||||||
"himFltrL": [
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "HIMCAT",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"jnyFltrL": [
|
|
||||||
{
|
|
||||||
"type": "LINEID",
|
|
||||||
"mode": "INC",
|
|
||||||
"value": 92404
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"serviceDays": {
|
|
||||||
"selectedWeekdays": "1111110",
|
|
||||||
"beginDate": "20250615",
|
|
||||||
"endDate": "20331211",
|
|
||||||
"beginTime": "00000000",
|
|
||||||
"endTime": "00235959"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"channels": [
|
|
||||||
{
|
|
||||||
"channelId": "{{ channel_id }}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"id": "1|12|"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
- name: "Zuginfo.nrw API"
|
|
||||||
hosts: localhost
|
|
||||||
vars:
|
|
||||||
unix_time_millis: "1762342729099"
|
|
||||||
aid: ""
|
|
||||||
mysterious_id: ""
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: "Subscribe to info for S4"
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrCreate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
|
||||||
method: POST
|
|
||||||
body: "{{ lookup('ansible.builtin.template','subscription_s4.json.j2') }}"
|
|
||||||
headers:
|
|
||||||
Accept-Encoding: gzip, deflate, br, zstd
|
|
||||||
Content-Type: application/json
|
|
||||||
Origin: https://www.zuginfo.nrw/
|
|
||||||
Referer: https://www.zuginfo.nrw/
|
|
||||||
TE: trailers
|
|
||||||
register: subscribe_s4
|
|
||||||
|
|
||||||
- name: "Print Result: Subscribe to S4"
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "{{ subscribe_s4 }}"
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
subscription_id: "{{ subscribe_s4.json.svcResL[0].res.subscrId }}"
|
|
||||||
|
|
||||||
- name: "Verify Subscription"
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
|
||||||
method: POST
|
|
||||||
body: "{{ lookup('ansible.builtin.template','verify_subscription.json.j2') }}"
|
|
||||||
headers:
|
|
||||||
Accept-Encoding: gzip, deflate, br, zstd
|
|
||||||
Content-Type: application/json
|
|
||||||
Origin: https://www.zuginfo.nrw/
|
|
||||||
Referer: https://www.zuginfo.nrw/
|
|
||||||
TE: trailers
|
|
||||||
register: verify_subscription
|
|
||||||
|
|
||||||
- name: "Print Result: Verify Subscription"
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "{{ verify_subscription }}"
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
- name: "Zuginfo.nrw API"
|
|
||||||
hosts: localhost
|
|
||||||
vars:
|
|
||||||
unix_time_millis: "1762342729099"
|
|
||||||
aid: ""
|
|
||||||
mysterious_id: ""
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
- name: "Update Subscription (no messages on S4 concerning Sundays)"
|
|
||||||
ansible.builtin.uri:
|
|
||||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUpdate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
|
||||||
method: POST
|
|
||||||
body: "{{ lookup('ansible.builtin.template','update_subscription.json.j2') }}"
|
|
||||||
headers:
|
|
||||||
Accept-Encoding: gzip, deflate, br, zstd
|
|
||||||
Content-Type: application/json
|
|
||||||
Origin: https://www.zuginfo.nrw/
|
|
||||||
Referer: https://www.zuginfo.nrw/
|
|
||||||
register: update_subscription
|
|
||||||
|
|
||||||
- name: "Print Result of Updating Subscription"
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "{{ update_subscription }}"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue