add source fetch script
this script can fetch all sources in json format from the riot website
This commit is contained in:
commit
389c7abe96
2 changed files with 38 additions and 0 deletions
32
fetchContent.sh
Normal file
32
fetchContent.sh
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
OUTPUT_DIR="content"
|
||||||
|
INPUT_FILE="${1:-urls.txt}"
|
||||||
|
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
|
||||||
|
# Validate input file
|
||||||
|
|
||||||
|
if [[ ! -f "$INPUT_FILE" ]]; then
|
||||||
|
echo "File not found: $INPUT_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
download() {
|
||||||
|
url="$1"
|
||||||
|
|
||||||
|
name=$(echo "$url" | awk -F/ '{print $(NF-1)}')
|
||||||
|
|
||||||
|
filename="${name}.json"
|
||||||
|
|
||||||
|
echo "Fetching: $url -> $filename"
|
||||||
|
|
||||||
|
curl -sS "$url" -o "$OUTPUT_DIR/$filename"
|
||||||
|
|
||||||
|
echo "Saved: $filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
export -f download
|
||||||
|
export OUTPUT_DIR
|
||||||
|
|
||||||
|
cat "$INPUT_FILE" | xargs -n 1 -P 5 bash -c 'download "$@"' _
|
||||||
6
riot-sources.txt
Normal file
6
riot-sources.txt
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
https://riotsecure.se/shield/content.json
|
||||||
|
https://riotsecure.se/brawl/content.json
|
||||||
|
https://riotsecure.se/oasis/content.json
|
||||||
|
https://riotsecure.se/fusion/content.json
|
||||||
|
https://riotsecure.se/microTLS/content.json
|
||||||
|
https://www.riotsecure.se/platform/content.json
|
||||||
Loading…
Reference in a new issue