Download from televideo

Download from televideo

Postby Silvio.Falconi » Thu Apr 14, 2022 9:43 am

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=786

I wish take this area

Image

and converte it on array automatically

how could this be done?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7052
Joined: Thu Oct 18, 2012 7:17 pm

Re: Download from televideo

Postby Silvio.Falconi » Thu Apr 14, 2022 10:15 pm

I tried with

Code: Select all  Expand view
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7052
Joined: Thu Oct 18, 2012 7:17 pm

Re: Download from televideo

Postby ADutheil » Fri Apr 15, 2022 3:44 pm

Code: Select all  Expand view
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
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Download from televideo

Postby Silvio.Falconi » Fri Apr 15, 2022 4:33 pm

ADutheil wrote:
Code: Select all  Expand view
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!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7052
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests

cron