<commit_before>#!/bin/sh
# Requires csvcut, from csvkit (0.9.0)
cd "$(dirname "$0")"

protocol='https:'

# read URL from data.csv
record="$(tail -n 1 ../data.csv)"
url="$protocol$(echo "$record" | csvcut -c 2)"

# read local file path from data.csv
filePath="$(echo "$record" | csvcut -c 3)"
file="../$filePath"

# create directory
mkdir -p "$(dirname "$file")"

# read userAgent from property file
. ../step1/userAgent.property.sh

curl \
  --silent --show-error \
  --user-agent "$userAgent" \
  --time-cond "$file" \
  --remote-time \
  --output "$file" \
  "$url" \
&& echo "Saved: $filePath"<commit_msg>Do not add 'https:' protocol in duplicate to wikimedia URL for SVG files<commit_after>#!/bin/sh
# Requires csvcut, from csvkit (0.9.0)
cd "$(dirname "$0")"

# read URL from data.csv
record="$(tail -n 1 ../data.csv)"
url="$(echo "$record" | csvcut -c 2)"

# read local file path from data.csv
filePath="$(echo "$record" | csvcut -c 3)"
file="../$filePath"

# create directory
mkdir -p "$(dirname "$file")"

# read userAgent from property file
. ../step1/userAgent.property.sh

curl \
  --silent --show-error \
  --user-agent "$userAgent" \
  --time-cond "$file" \
  --remote-time \
  --output "$file" \
  "$url" \
&& echo "Saved: $filePath"
{'fraction_non_alphanumeric': 0.20529270248596632, 'fraction_numerical': 0.012830793905372895, 'mean_word_length': 3.25938566552901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1470293', 'n_tokens_mistral': 477, 'n_tokens_neox': 445, 'n_words': 132}