Created
March 27, 2019 23:33
-
-
Save wy/56b4d0d2f47b6f4cdeadb59b8cb0ab7f to your computer and use it in GitHub Desktop.
lazyload bash lookfantastic
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
#!/bin/bash | |
for i in {1..1000}; | |
do | |
sudo lighthouse https://www.lookfantastic.com --extra-headers='{"x-thehutsrv":"227"}' --chrome-flags="--headless --no-sandbox" --output=json --output-path=test.json --quiet | |
speedindex=$(cat test.json | jq '.["audits"]' | jq '.["speed-index"]' | jq '.["rawValue"]') | |
totalbyteweight=$(cat test.json | jq '.["audits"]' | jq '.["total-byte-weight"]' | jq '.["rawValue"]') | |
interactive=$(cat test.json | jq '.["audits"]' | jq '.["interactive"]' | jq '.["rawValue"]') | |
printf '%s\n' $speedindex $totalbyteweight $interactive | paste -sd ',' >> lookfantastic.csv | |
printf '%s,' "normal" $speedindex $totalbyteweight $interactive | |
printf '\n' | |
sudo lighthouse https://www.lookfantastic.com?hasLazyLoadingImages=true --extra-headers='{"x-thehutsrv":"227"}' --chrome-flags="--headless --no-sandbox" --output=json --output-path=test.json --quiet | |
speedindex=$(cat test.json | jq '.["audits"]' | jq '.["speed-index"]' | jq '.["rawValue"]') | |
totalbyteweight=$(cat test.json | jq '.["audits"]' | jq '.["total-byte-weight"]' | jq '.["rawValue"]') | |
interactive=$(cat test.json | jq '.["audits"]' | jq '.["interactive"]' | jq '.["rawValue"]') | |
printf '%s\n' $speedindex $totalbyteweight $interactive | paste -sd ',' >> lookfantasticll.csv | |
printf '%s,' "lazy" $speedindex $totalbyteweight $interactive | |
printf '\n' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment