grs icon indicating copy to clipboard operation
grs copied to clipboard

Use current time to update latest stock list info from official sites

Open paullo0106 opened this issue 9 years ago • 3 comments

I think it would be more convenient and make more sense to use the current time rather than a hard-coded past time for generating csv files of the latest stock info, that's the main reason I made those changes :p

paullo0106 avatar Nov 20 '14 15:11 paullo0106

@paullo0106 這遇到六日或是沒開市日就抓不到資料 XD,不過感謝你的 PR,我這禮拜加入,感謝你。

toomore avatar Nov 20 '14 16:11 toomore

Oh yeah, I didn't think of weekend issue. Just made some more changes on those two files using urllib3 consistently (previously opened by you in issue #7)

paullo0106 avatar Nov 20 '14 17:11 paullo0106

@toomore 針對你提的"六日或是沒開市日"的問題,我剛才加了一些程式碼: base on你原本的TWSEOpen d_day()延伸了一個recent_open_day() function,如果今天沒開市就往前一天去check,直到有開市的那天為止。 (原本在想會不會有infinite loop,但我還沒有試出這樣的日期,看起來d_day()支援的時間區間似乎滿完整的)

paullo0106 avatar Nov 26 '14 07:11 paullo0106