-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 2.06 KB
/
scrape.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
name: Scrape latest data
on:
push:
workflow_dispatch:
schedule:
- cron: '6,26,46 * * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Test with pytest
env: # Or as an environment variable
QRZ_PSWD: ${{ secrets.QRZ_PSWD }}
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
run: |-
pip install pytest
pytest
- name: Fetch latest data
env: # Or as an environment variable
QRZ_PSWD: ${{ secrets.QRZ_PSWD }}
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
run: |-
echo "{" > incidents.json
curl 'https://www.reversebeacon.net/spots.php?h=4f6ae8&cdx=KD0F*&s=0&r=100' | jq '.spots[]|= .[0:6]|.spots ' | sed '/\}/d' | sed '/{/d' >> incidents.json
echo "," >> incidents.json
curl 'https://www.reversebeacon.net/spots.php?h=4f6ae8&cdx=KO6B*&s=0&r=100' | jq '.spots[]|= .[0:6]|.spots ' | sed '/\}/d' | sed '/{/d' >> incidents.json
echo "}" >> incidents.json
echo "{" > stations_geo.json
curl 'https://www.reversebeacon.net/spots.php?h=4f6ae8&cdx=KD0F*&s=0&r=100' | jq '.call_info ' | sed '/\}/d' | sed '/{/d' >> stations_geo.json
echo "," >> stations_geo.json
curl 'https://www.reversebeacon.net/spots.php?h=4f6ae8&cdx=KO6B*&s=0&r=100' | jq '.call_info ' | sed '/\}/d' | sed '/{/d' >> stations_geo.json
echo "}" >> stations_geo.json
python kepler_geo.py > rm_rnb_history.csv
git config pager.diff false
cat rm_rnb_history.csv | python nkc.py >> rm_rnb_history_pres.csv
python map_qso.py -hh >> rm_rnb_history_pres.csv
echo "" > qso_locs.txt
cat qso_update_template.csv > qso_update.csv
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push