From 6bb8c3ec28ae1c508eb865796a78c16ea44be3f2 Mon Sep 17 00:00:00 2001 From: riyadeb4321 Date: Wed, 17 Jul 2019 14:44:20 +0530 Subject: [PATCH] batman script added --- week-0/day-1/batman.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 week-0/day-1/batman.sh diff --git a/week-0/day-1/batman.sh b/week-0/day-1/batman.sh new file mode 100644 index 00000000..1cae2a99 --- /dev/null +++ b/week-0/day-1/batman.sh @@ -0,0 +1,18 @@ +#html file +wget "https://wallpapercave.com/dark-knight-hd-wallpaper"; + +mainImages=$(grep -o 'slug="dark-knight-hd-wallpaper.*"' dark-knight-hd-wallpaper) + +#to get child path =" https://wallpapercave.com/wp/IQNtlNL.jpg" from main site +imgs=$(grep -o "/wp/.*jpg" <<< "$mainImages"); + +#main website +url="https://wallpapercave.com/"; + +#downloading all the images from ^img that child slug using wget +for i in $imgs; do + wget $url$i +done + +#delete html file +rm dark-knight-hd-wallpaper