You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
634 B
11 lines
634 B
7 years ago
|
#!/usr/bin/bash
|
||
|
markup=$(curl https://www.packtpub.com/packt/offers/free-learning 2> /dev/null | sed 's/"\/\//"https:\/\//g')
|
||
|
#img=$(echo "$markup" | sed -n "/dotd-main-book-image/,$ p" | head | sed -n "/<img/ p")
|
||
|
#img=$(echo "$markup" | sed -n "/dotd-main-book-image/,$ p" | head | sed -n "/<img/ p" | sed -nr "s/.*<img.*?src=[\"|'](.*?)[\"|'].*/\3/p")
|
||
|
img=$(echo "$markup" | sed -n "/dotd-main-book-image/,$ p" | head | sed -n "/<img/ p" | sed -nr 's/.*?<img src="([^"]*)".*img.*/\1/p')
|
||
|
curl "$img" > /tmp/freeBook 2> /dev/null
|
||
7 years ago
|
clear
|
||
7 years ago
|
imgcat /tmp/freeBook
|
||
|
rm /tmp/freeBook
|
||
7 years ago
|
echo "https://www.packtpub.com/packt/offers/free-learning#"
|