應用程式/解決方案‎ > ‎雜記‎ > ‎專題‎ > ‎行情‎ > ‎

HTTP下載用的小工具

SGX已不再更新舊的HTTP歷史資料文件, 只能改用HTTPS的方式配合, 反倒是更容易一些

文字框


Usage1:
        EzSgxDL obj[ file[ size[ host]]]
Usage2:
        EzSgxDL key[ file[ size[ host]]]

obj     - uri on the host
  Ex1:    "/1.0.0/derivatives-historical/4388/WEBPXTICK_DT.zip"
  Ex2:    ""
key     - key number for the default uri on the host
  Ex1:    4388
  Ex2:    ""
file    - file to save content-data
  Ex1:    "WEBPXTICK_DT.zip"
  Ex2:    ""     using attachment filename
size    - a large enough cache size to store Http/Content data
  Ex:     33554432
host    - server domain
  Ex:     links.sgx.com

Retuen Code:
        0        no data
        1        have content
        2        have file save

新版網頁找不到key嗎? 試試: http://ftw.tw/pub/tech/SGX/time_sales.asp
舊版備份: 2019-07-11


TFE每日Tick(下載)
TFE下載頁面 http://www.taifex.com.tw/cht/3/dlFutPrevious30DaysSalesData

可用參數 預設內容
/host www.taifex.com.tw
/out 當日預設檔名: Daily_yyyy_mm_dd.zip
/url 當日預設網址: /file/taifex/Dailydownload/DailydownloadCSV/Daily_yyyy_mm_dd.zip
(新的url須注意大小寫)

直接執行為抓取當時日期作為預設資料

舊的url版(下載)
TFE下載頁面已移除( www.taifex.com.tw/chinese/3/dl_3_1_3.asp ), 此仍可使用, 舊的url位址沒有區分大小寫

可用參數 預設內容
/host www.taifex.com.tw
/out 當日預設檔名: Daily_yyyy_mm_dd.zip
/url 當日預設網址: /DailyDownload/DailyDownloadCSV/Daily_yyyy_mm_dd.zip

直接執行為抓取當時日期作為預設資料

TWSE每5秒指數統計(下載)
大家都以為HTTPS是萬靈丹, 不須要用的也要套用, 那就配合吧~
TSE下載頁面 https://www.twse.com.tw/zh/page/trading/exchange/MI_5MINS_INDEX.html

簡易(HTTPS)下載程式, 也可用於下載其他HTTPS資源

Usage:
        EzTwseDL.exe obj[ file[ size[ host]]]

obj     - uri on the host
  Ex1:    "/exchangeReport/MI_5MINS_INDEX?response=csv&date=20190603"
  Ex2:    ""     using default value
file    - file to save content-data
  Ex1:    20190603.csv
  Ex2:    ""     using default value
size    - a large enough cache size to store content-data
  Ex:     4194304
host    - server domain
  Ex:     www.twse.com.tw

Retuen Code:
        0        no data
        1        have content
        2        have file save

請注意, 由於obj這個參數會有像 &date=20190603 這樣的內容, 而在命令列下 & 和 date= 會被另作解釋, 因此要用引號括起來




子網頁 (1): 過時的備份內容
註解