← 前のページに戻る
1.6 WWW版経済指標表示プログラム
1.6.1 ソース
#!/usr/local/bin/descartes
? ::sys <PrintResultOff>;
<proxy #proxy>
(::sys <getenv #p http_proxy> | <is #p "">)
::sys <split #p1 #p "/">
( <eq #p1 ()> <is #proxy "">
|
::sys <car #p2 #p1>
<is "http:" #p2> ::sys <cadr #proxy #p1>
|
<is #proxy #p>
)
;
<disp>
<printf "loading...">
::sys <httpget #h #b "http://www.nikkei.com/" <proxy _>>
::sys <iconv #bs #b "SJIS" "UTF-8">
::sys <strdelcntl #bu #bs>
::sys <replacestr #b1 #bu "</td>" " ">
::sys <replacestr #b2 #b1 "</th>" " ">
::sys <replacestr #b3 #b2 "ドル/円" "ドル/円 ">
::sys <htmltags #t #b3 'div class="cmn-sub_market"' 'div class="cmn-sub_square_banner"'>
::sys <htmltags #t1 #t "tr" "/tr">
::sys <erasealltags #t2 #t1>
::sys <car #list #t2>
<print "completed">
<for (#i 60)
<print 主な経済指標>
<printlistnl #list>
<print>
::sys <sleep 10>
>
;
? {<disp>};