Skip to content

Instantly share code, notes, and snippets.

@rolandcrosby
Created May 26, 2019 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolandcrosby/0c0b190bb9b4b5b7e5cdaa697ccaf286 to your computer and use it in GitHub Desktop.
Save rolandcrosby/0c0b190bb9b4b5b7e5cdaa697ccaf286 to your computer and use it in GitHub Desktop.
fetch all the room photos from the muji hotel website
#!/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