Page 1 of 1
Download from televideo
Posted: Thu Apr 14, 2022 9:43 am
by Silvio.Falconi
I have this link from Televideo ( Televideo is the name of the teletext service started by Italian Rai Television since 1984)
http://www.televideo.rai.it/televideo/p ... pagina=786I wish take this area

and converte it on array automatically
how could this be done?
Re: Download from televideo
Posted: Thu Apr 14, 2022 10:15 pm
by Silvio.Falconi
I tried with
Code: Select all | Expand
Function TestUrl(cUrl)
local cRet := WebPageContents( cUrl )
local cFile:="test.txt"
if Empty( cRet )
? "Invalid URL"
else
? cRet
endif
memoedit( cRet )
return nil
How I canto save that part of cRet ?
Re: Download from televideo
Posted: Fri Apr 15, 2022 3:44 pm
by ADutheil
Code: Select all | Expand
Function TestUrl( cUrl )
local cRet := WebPageContents( cUrl )
local cFile := "test.txt"
LOCAL cBuff
LOCAL nHndl
LOCAL aShow
LOCAL nI
if Empty( cRet )
? "Invalid URL"
else
cRet := subStr( cRet, at( "BARI", cRet ) )
cRet := allTrim( subStr( cRet, 1, at( "Controlla", cRet ) - 1 ) )
nHndl := fCreate( cFile )
fWrite( nHndl, cRet )
fClose( nHndl )
IF ( nHndl := fOpen( cFile ) ) < 1
msgStop( "UNABLE TO OPEN: " + cFile )
ELSE
aShow := {}
WHILE hb_fReadLine( nHndl, @cBuff, chr( 10 ) ) == 0
cBuff := allTrim( cBuff )
IF ! empty( cBuff )
aAdd( aShow, {} )
aAdd( aTail( aShow ), subStr( cBuff, 1, 11 ) )
FOR nI := 12 TO 28 STEP 4
aAdd( aTail( aShow ), subStr( cBuff, nI, 2 ) )
NEXT
ENDIF
ENDDO
xBrowse( aShow )
ENDIF
endif
return nil
Re: Download from televideo
Posted: Fri Apr 15, 2022 4:33 pm
by Silvio.Falconi
ADutheil wrote:Code: Select all | Expand
Function TestUrl( cUrl )
local cRet := WebPageContents( cUrl )
local cFile := "test.txt"
LOCAL cBuff
LOCAL nHndl
LOCAL aShow
LOCAL nI
if Empty( cRet )
? "Invalid URL"
else
cRet := subStr( cRet, at( "BARI", cRet ) )
cRet := allTrim( subStr( cRet, 1, at( "Controlla", cRet ) - 1 ) )
nHndl := fCreate( cFile )
fWrite( nHndl, cRet )
fClose( nHndl )
IF ( nHndl := fOpen( cFile ) ) < 1
msgStop( "UNABLE TO OPEN: " + cFile )
ELSE
aShow := {}
WHILE hb_fReadLine( nHndl, @cBuff, chr( 10 ) ) == 0
cBuff := allTrim( cBuff )
IF ! empty( cBuff )
aAdd( aShow, {} )
aAdd( aTail( aShow ), subStr( cBuff, 1, 11 ) )
FOR nI := 12 TO 28 STEP 4
aAdd( aTail( aShow ), subStr( cBuff, nI, 2 ) )
NEXT
ENDIF
ENDDO
xBrowse( aShow )
ENDIF
endif
return nil
thanks very good
I need also the date and I made
local cData := WebPageContents( cUrl )
cData := subStr( cData, at( "ALMANACCO", cData )+9 )
cData := allTrim( subStr( cData, 1, at("BARI", cData ) -1 ) )
XBROWSER aShow title "Estrazione del "+ cdata
Run ok but I not Know if it 's Right!!!