Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@qeesung
Created August 8, 2018 16:47
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 qeesung/9c7065548b6622e1ffda2e73604278a8 to your computer and use it in GitHub Desktop.
Save qeesung/9c7065548b6622e1ffda2e73604278a8 to your computer and use it in GitHub Desktop.
for((i=0;i<100000;i++))
do
count=`curl -s 'https://time.geekbang.org/serv/v1/column/intro' -H 'Pragma: no-cache' -H 'Origin: https://time.geekbang.org' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: zh,en;q=0.9,zh-TW;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/plain, */*' -H 'Cache-Control: no-cache' -H 'Referer: https://time.geekbang.org/column/intro/112?code=ti58hl0Fap2y5S-OE0G-O-2CiCtjLT94OxcNaBDzI6k%3D' -H 'Cookie: _ga=GA1.2.410744945.1525346650; _gid=GA1.2.1852707145.1533744099; orderInfo={%22list%22:[{%22count%22:1%2C%22image%22:%22https://static001.geekbang.org/resource/image/e2/a7/e26ce9e197c4220135aa8780199e4da7.jpg%22%2C%22name%22:%22Go%E8%AF%AD%E8%A8%80%E6%A0%B8%E5%BF%8336%E8%AE%B2%22%2C%22sku%22:100013101%2C%22price%22:{%22sale%22:4500}}]%2C%22invoice%22:false%2C%22app_id%22:3%2C%22cid%22:112%2C%22isFromTime%22:true%2C%22detail_url%22:%22https://time.geekbang.org/column/intro/112%22%2C%22shareSaleCode%22:%22ti58hl0Fap2y5S-OE0G-O-2CiCtjLT94OxcNaBDzI6k=%22}; GCID=379c8ee-9f00de1-8f04ceb-49c6c26; GCESS=BAcE_Y8ONAEEuakPAAwBAQIECBRrWwgBAwkBAQsCBAAKBAAAAAADBAgUa1sFBAAAAAAGBBB_Sn4EBIBRAQA-; _gat=1; SERVERID=97796d411bb56cf20a5612997f113254|1533744404|1533744095' -H 'Connection: keep-alive' --data-binary '{"cid":"112","with_groupbuy":true}' --compressed | jq ".data.sub_count"`
echo sub count : $count
i=$((10480-$count))
echo $i more ...
if [ $i -le 3 ]
then
notepad
tput bel
exit
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment