-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 2.19 KB
/
Copy pathMakefile
File metadata and controls
74 lines (60 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
all: \
tmp/cookie.txt \
tmp/homepage.html \
tmp/sitemap.html \
tmp/collections.txt \
fetch_collections \
extract_product_id \
fetch_products_json \
build_search_csv
curl_options = -s \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
-H 'accept-language: ja-JP,ja;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'priority: u=0, i' \
-H 'sec-ch-ua: "Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'sec-fetch-dest: document' \
-H 'sec-fetch-mode: navigate' \
-H 'sec-fetch-site: none' \
-H 'sec-fetch-user: ?1' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36'
tmp/cookie.txt:
bash ./scripts/fetch_cookie.sh
clean:
rm -f ./tmp/cookie.txt
rm -f ./tmp/homepage.html
rm -f ./tmp/collections.txt
rm -f ./tmp/collections_uniq.txt
rm -f ./tmp/collections/*
clean-all:
rm -f ./public/products.txt
rm -f ./public/search_*.csv
tmp/homepage.html:
curl -o tmp/homepage.html $(curl_options) https://jp.louisvuitton.com/jpn-jp/homepage
tmp/sitemap.html:
curl -o tmp/sitemap.html $(curl_options) https://jp.louisvuitton.com/jpn-jp/sitemap
tmp/collections.txt:
cat tmp/homepage.html | htmlq --attribute href a | grep "N-" | rev | cut -d '/' -f 1 | rev | sed -e 's/N-//' > tmp/collections.txt
cat tmp/sitemap.html | htmlq --attribute href a | grep "N-" | rev | cut -d '/' -f 1 | rev | sed -e 's/N-//' >> tmp/collections.txt
cat tmp/collections.txt | sort | uniq > tmp/collections_uniq.txt
.PHONY: fetch_homepage
fetch_homepage:
mkdir -p ./tmp/collections
bash ./scripts/fetch_homepage.sh
.PHONY: fetch_collections
fetch_collections:
mkdir -p ./tmp/collections
bash ./scripts/fetch_collections.sh
.PHONY: extract_product_id
extract_product_id:
bash ./scripts/extract_product_id.sh
.PHONY: fetch_products_json
fetch_products_json:
bash ./scripts/fetch_products_json.sh
.PHONY: fetch_products_image
fetch_products_image:
bash ./scripts/fetch_products_image.sh
.PHONY: build_search_csv
build_search_csv:
bash ./scripts/build_search_csv.sh