-
Notifications
You must be signed in to change notification settings - Fork 1
/
watch.sh
41 lines (30 loc) · 1 KB
/
watch.sh
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
# diagram recent wiki-plugin-wsjt traffic
# usage: sh watch.sh 20
while sleep 15; do
curl -s ward.asia.wiki.org/plugin/wsjt/copy |\
tee copy.txt | egrep ' (R[+-]|RR73|RRR)' |\
tee conf.txt | tail -${1:-50} > show.txt
tail -1 conf.txt
(echo strict digraph { rankdir=LR layout=neato
echo node [style=filled fillcolor=gold]
cat show.txt | perl -ne '
print "$&\n" while(/\b(K9OX|KD7MPA)\b/g)' |\
sort | uniq
echo node [fillcolor=palegreen]
cat show.txt | perl -ne '
print "$&\n" while(/\b[A-Z]+\d[A-Z]+\b/g)' |\
egrep -v '^[WKAN]' |\
sort | uniq
echo node [fillcolor=bisque]
cat show.txt | perl -ne '
print "$2 -> $1\n"
while(/([A-Z]+\d[A-Z]+) ([A-Z]+\d[A-Z]+)/g)' |\
sort | uniq
cat show.txt | perl -ne '
print "$& [URL=\"https://duckduckgo.com/?q=$&\"]\n" while(/\b[A-Z]+\d[A-Z]+\b/g)' |\
sort | uniq
echo } ) |\
tee map.dot | dot -Tsvg > view.svg
cp map.dot view.dot
scp -q view.svg asia:.wiki/ward.asia.wiki.org/assets/pages/radios-social-network/view.svg
done