Renamed all directories, created index.html and the like

This commit is contained in:
2024-05-29 03:24:42 +03:00
parent cfb70d9699
commit 7e7935ee4a
256 changed files with 348 additions and 257 deletions

20
_scripts/extract.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash -x
old_file="$1"
new_file="${old_file/src/dst}"
tmp1_file="$(mktemp /tmp/taro.XXXXXX)"
tmp2_file="$(mktemp /tmp/taro.XXXXXX)"
# Extract the content of the page
xmllint --html --xpath '//div[@class="content-wrapper"]' 2>/dev/null "$old_file" > "$tmp2_file"
# Remove the unnecessary content
awk '{
if ($0 ~ /Смотрите все толкования карт/) {
exit
}
print $0
}' "$tmp2_file" > "$new_file"
# Remove the temporary files

38
_scripts/get.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash -x
# Set base URL
base_url="https://www.predskazanie.ru"
data_url="${base_url}/znacheniya-kart-taro"
jpeg_url="${base_url}/taro-karty"
# Major arcana names
major_names=(
shut mag zhrica imperatrica imperator
ierofant vlyublennye kolesnica spravedlivost
otshelnik koleso-fortuny sila poveshennyi smert
umerennost diavol bashnya zvezda luna solnce sud mir
)
# Major arcana numbers (roman numerals)
major_numbers=(0 I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX XXI)
# Download major arcana
for i in {0..21}
do
echo "Now downloading ${major_names[$i]}"
wget "${data_url}/${major_names[$i]}.php"
wget "${jpeg_url}/${major_numbers[$i]}-${major_names[$i]}.jpg" -O "${major_names[$i]}.jpg"
done
# Download minor arcana
for arcana in zhezlov kubkov metchey monet
do
for number in tuz {2..10} pazh rytsar koroleva korol
do
echo "Now downloading ${number} ${arcana}"
wget "${data_url}/${number}-${arcana}.php"
wget "${jpeg_url}/${number}-${arcana}.jpg"
done
done