-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (104 loc) · 4.26 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Scrape latest data
on:
push:
workflow_dispatch:
schedule:
- cron: '5 * * * *'
jobs:
mvg:
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Check out this repo
if: always()
uses: actions/checkout@v3
- name: slim
if: always()
run: |-
curl 'https://www.mvg.de/api/ems/slim' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'referer: https://www.mvg.de/' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > slim.json
- name: mvgStationGlobalIds
if: always()
run: |-
curl 'https://www.mvg.de/.rest/zdm/mvgStationGlobalIds' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'referer: https://www.mvg.de/' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > mvgStationGlobalIds.json
- name: tickers
if: always()
run: |-
curl 'https://www.mvg.de/api/ems/tickers' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'pragma: no-cache' \
-H 'referer: https://www.mvg.de/' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > tickers.json
- name: christmas-markets
if: always()
run: |-
curl 'https://move.mvg.de/christmas-markets.json' \
-H 'authority: move.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > christmas-markets.json
- name: departure
if: always()
run: |-
curl 'https://www.mvg.de/api/fib/v2/departure?globalId=de:09162:750&limit=10&offsetInMinutes=0&transportTypes=UBAHN,TRAM,BUS,SBAHN,SCHIFF' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > departure.json
- name: ff-750
if: always()
run: |-
curl 'https://www.mvg.de/.rest/mvgZoom/api/stations/750' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > ff-750.json
- name: stations
if: always()
run: |-
curl 'https://www.mvg.de/.rest/mvgZoom/api/stations' \
-H 'authority: www.mvg.de' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: de' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0' \
--compressed > stations.json
- name: Commit and push if it changed
if: always()
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push