summaryrefslogtreecommitdiffstats
path: root/.local/bin/getberts
blob: ca6543d6cd839b0d5ccfdffe6b2ab4c80f6dbe3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/zsh

#Description: Downloads as many strips from the comic "dilbert" as it can get its hands on. I primarily use it for data science.

#Axioms: ULTRASPECIFIC

#Dependencies: https://packages.debian.org/sid/parallel https://packages.debian.org/sid/tor https://packages.debian.org/sid/wget https://packages.debian.org/sid/curl https://github.com/ericchiang/pup 


getbert() {
    echo $1
    url=$(curl "$1"|pup 'img[class="img-responsive img-comic"] attr{src}') || exit 1
    torsocks wget --continue --directory-prefix="/home/$USER/Documents/ComputerScience/programs/lightweight_gan/data/dilbert/" $url
}

env_parallel --jobs 3 getbert {} ::: $(for year in {1999..2023}; do for month in {01..12}; do for day in {01..31};do echo https://dilbert.com/strip/$year-$month-$day;done;done;done)