Skip to content

Instantly share code, notes, and snippets.

@elleryq
Last active August 29, 2015 14:27
Show Gist options
  • Save elleryq/7f5b71c545cfae944443 to your computer and use it in GitHub Desktop.
Save elleryq/7f5b71c545cfae944443 to your computer and use it in GitHub Desktop.
從群益權民最大網撈資料
#!/bin/bash
curl 'http://iwarrant.capital.com.tw/data/warrants/Get_wScreenerResultCont.aspx?wcodelist=036888,06506P,036662,06489P,035979,06354P,035347,05346P,06499P,035146,04813P,05973P,034019,05238P,06355P,033970,05489P,032748,035253,04814P,06051P,032154,035147,05584P,05609P,030854,034528,05525P,030443,034365&ndays_sv=60&_=1440129426372' -H 'Host: iwarrant.capital.com.tw' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0' -H 'Accept: */*' -H 'Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'X-Requested-With: XMLHttpRequest' -H 'Referer: http://iwarrant.capital.com.tw/warrants/wScreenerPull.aspx?ul=0050&ts=1440081747608' -H 'Cookie: ASP.NET_SessionId=g1ks0u45ylpceo3dv54bcz55' -H 'Connection: keep-alive' -o /tmp/output-big5.json
# the json is encoded with big5, convert it!
iconv -f big5 -t utf-8 -o /tmp/output.json /tmp/output-big5.json
# Please install 'jq' first: sudo apt-get install jq
# You can try filter syntax in https://jqplay.org
jq ".[] | .item.scode" tmp/output.json
jq ".[] | .item.ulsname" tmp/output.json
jq ".[0].item.ulsname" tmp/output.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment