-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathgenerate-stubs.sh
More file actions
executable file
·29 lines (22 loc) · 914 Bytes
/
generate-stubs.sh
File metadata and controls
executable file
·29 lines (22 loc) · 914 Bytes
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
#!/bin/bash
set -euo pipefail
year="2020"
numbers=($(curl --silent https://developer.apple.com/videos/wwdc$year | grep '<a href="/videos/play/' | sed -e 's/^[[:space:]]*//' | awk -F'[\"><]' '{print $3}' | cut -d'/' -f5 | uniq))
IFS=$'\n' && titles=($(curl --silent https://developer.apple.com/videos/wwdc$year | grep '<h4 class="no-margin-bottom video-title">' | sed -e 's/^[[:space:]]*//' | awk -F'[\"><]' '{print $5}'))
# Generate stubs for all sessions
for i in "${!numbers[@]}"; do
number=${numbers[$i]}
title=${titles[$i]}
file="summaries/$year/$number.md"
if [ -f $file ]; then
printf "✅ %s\t%s\n" $number $title
else
printf "❌ %s\t%s\n" $number $title
cat <<EOT > $file
## $title
https://developer.apple.com/wwdc20/$number
Presenters: _Example Guy, Another Person_
##### TO-DO! You can contribute to this session, please see [CONTRIBUTING.md](CONTRIBUTING.md)
EOT
fi
done