Created
May 26, 2019 18:23
-
-
Save rolandcrosby/0c0b190bb9b4b5b7e5cdaa697ccaf286 to your computer and use it in GitHub Desktop.
fetch all the room photos from the muji hotel website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
for city in ginza shenzhen beijing; do | |
for room in {a..z} ; do | |
pic=0 | |
while true; do | |
((pic++)) | |
fn="${room}_${pic}.jpg" | |
curl --fail "https://hotel.muji.com/${city}/wp-content/themes/mujihotel${city}/img/rooms_type_$fn" -o "${city}_${fn}" | |
if [ $? -ne 0 ]; then | |
if [ $pic -eq 1 ]; then | |
break 2 | |
else | |
break | |
fi | |
fi | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment