"$d_Qdfs""economics, markets/winURL yahoo finance news download develop.txt" # www.BillHowell.ca 25Apr2020 initial # view this file in a text editor, with [constant width font, tab = 3 spaces], no line-wrap 24************************24 08********08 15May2021 # olde code % write 'winID_optionsURL = ' winID_optionsURL ; % IF (NOT isfault winID_optionsURL) THEN % host 'sleep 2s' ; % ENDIF ; % winID_optionsURL := winTitle_get_winID (5 take winNm_optionsURL) ; % URL := link URL_base url_strike ; % winNm_optionsURL := link symbol ' ' ; URL := URL_base ; 08********08 25Apr2021 create 'text - yahoo finance news download.ndf' The paste via command into geany doesn't work : host link 'xdotool key --window ' winID_geany ' ctrl+v' ; but when I do Ctrl-v in the geany window the webPageText is pasted in +-----+ winIDorTitle_close winID_yahooNews ; >> doesn't work yet >> I fixed basic optrs in other files >> Ctrl+q doesn't alwaclose firefox browser (maybe do twice?) Shit - I closed ALL firefox [tab, windows!! Change : +.....+ f_geany := 'webPage_copyTextTo_pname temp.txt' ; p_geany := link d_temp f_geany ; winID_geany := winIDorTitle_get_winID (12 take p_geany) ; +.....+ To : +.....+ p_geany := link d_temp 'webPage_copyTextTo_pname temp.txt' ; winID_geany := winIDorTitle_get_winID (12 take f_geany) ; +.....+ Huge number of small bug fixes, finally this is copy-pasting sucessfully : +--+ yahooNews_downLoad IS { LOCAL d_Markets d_start delay_brs f_temp p_newsCurrent URL winID_yahooNews yahooNews_winName ; NONLOCAL d_bin d_webRawe d_yahoo p_yahooNews ; % ; % [dir, file, etc] definitions - specific forthis optr ; d_start := link d_bin 'starter/' ; f_temp := 'yahooNews_downLoad temp.txt' ; URL := 'https://finance.yahoo.com/news/' ; yahooNews_winName := 'Latest Financial and Business News - Yahoo Finance' ; % ; % backup p_yahoo ; path_backupDatedTo_dir p_yahooNews (link d_yahoo 'z_Archive/') ; % ; % open yahoo financial news URL in browser, code from "$d_bin""starter/start_Markets.sh" ; host 'wmctrl -s 5' ; delay_brs := ' 1s ' ; cmd := link 'bash "' d_start '""start_app.sh" ' delay_brs ' "browser" "https://finance.yahoo.com/news/" ""' ; write cmd ; host cmd ; host 'sleep 5s' ; winID_yahooNews := winIDorTitle_get_winID (12 take yahooNews_winName) ; host 'sleep 3s' ; write 'winID_yahooNews = ' winID_yahooNews ; p_newsCurrent := winIDorName_copyAllTextTo_ptemp yahooNews_winName f_temp ; winIDorTitle_close winID_yahooNews ; % ; % ToDo - p_newsCurrent remove html junk, adds, etc] ; % ; % ToDo - remove from p_newsCurrent any current news already present ; % ; % update p_yahooNews ; % host link 'cat "' p_yahooNews '" >"' p_newsCurrent '"' ; % host link 'mv "' p_newsCurrent '" "' p_yahooNews '"' ; } +--+ # str_splitBy_char `, 'Treasuries Reprieve Buoys Emerging Markets, but Buyers Are Picky' # str_splitBy_str '•' 'Bloomberg•3 hours ago' # [first, last] str_splitWith_subStr '•' 'Bloomberg•3 hours ago' # pinn := link d_temp 'yahooNews_downLoad temp.txt' # pout := link d_temp 'yahooNews_downLoad temp processed.txt' # pinn_yahooNewsItemsExtract_pout pinn pout # pinn := link d_yahoo 'yahoo finance news.txt' # pout := link d_temp 'yahooNews_downLoad 210424 processed.txt' # pinn_yahooNewsItemsExtract_pout pinn pout 08********08 25Apr2021 create 'text - yahoo finance news download.ndf' host link 'xdotool key --window ' winID_page ' ctrl+A' ; >> This opened a new FireFox tab "Add-Ons" in the correct window Change : +.....+ host link 'xdotool key --window ' winID_page ' ctrl+A' ; host link 'xdotool key --window ' winID_temp ' ctrl+V' ; +.....+ To : +.....+ host link 'xdotool key --window ' winID_page ' ctrl+a' ; host link 'xdotool key --window ' winID_temp ' ctrl+v' ; +.....+ >> OK, doesn't start a new tab Now - will it paste into the temp geany window? +---+ -->[nextv] winid_temp ?winIDorTitle_get_winID multiple winIDs or fault +---+ >> maybe I have to save that file first? # wmctrl -ia winID - the i means that the ID is a number, not a name +---+ host link 'wmctrl -ia ' winID_page ; host 'sleep 1s' ; host link 'xdotool key --window ' winID_page ' ctrl+a' ; host 'sleep 1s' ; host link 'xdotool key --window ' winID_page ' ctrl+c' ; host 'sleep 1s' ; +---+ >> this highlighted the yahoo window, highlighted all text, >> perhaps it also copied the text?? >> it did NOT copy the text into 'webPage_copyTextTo_pname temp.txt' redid, with : write 'winID_temp = ' winID_temp ; >> OK, winID OK, and when I dd Ctrl-v in the geany window the webPageText was pasted in >> but this lid NOT paste : host link 'xdotool key --window ' winID_temp ' ctrl+v' ; # enddoc