|
Post by alexfish on Sept 12, 2020 20:42:04 GMT 1
Hi Peter got a problem with splits the code and the text file is in the archive Not sure what is happening but on pi the splits are not working with this type of file ' test scraper DECLARE B$ TYPE STRING B$ = LOAD$("test.txt")
'B$ = "ar $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return"
DECLARE dimension,ck TYPE int LOCAL dimension2, TYPE int
SPLIT B$ BY "\n" TO array$ SIZE dimension DECLARE c$,d$,e$ TYPE STRING DECLARE qt$ = CHR$(34) DECLARE lt$ , rt$ TYPE STRING
FOR t = 0 TO dimension -1 c$ = array$[t] 'c$ = CHOP$(c$) ck = INSTR(c$,"{") 'PRINT LEN(c$) IF ck THEN SPLIT c$ BY "{" TO array2$ SIZE dimension2 PRINT "Size of Splits :",dimension2 FOR s = 0 TO dimension2 -1 d$=array2$[s] PRINT "bracket:", s , ":", LEN(d$),".->",d$ ,"{\n" NEXT ELSE PRINT "none:",s ,":" ,LEN(c$) , "->" , c$ END IF
NEXT BR Alex Attachments:test.txt.bz2 (2.12 KB)
|
|
|
Post by rikky on Sept 13, 2020 9:51:24 GMT 1
I think you have forgotten the OPTION QUOTED FALSE
Rik.
|
|
|
Post by alexfish on Sept 13, 2020 13:25:16 GMT 1
I think you have forgotten the OPTION QUOTED FALSE
Rik. Thanks Rik can now parse web sites like youtube where the bits are encapsulated in javascript example "videoId":"q-EW4-B11hw","thumbnail":{
"thumbnails":[{
"url":"https://i.ytimg.com/vi/q-EW4-B11hw/hq720.jpg?sqp=-oaymwEjCOgCEMoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLC786z56UmqCjqCHR0t2un4kPcYng","width":360,"height":202},{
"url":"https://i.ytimg.com/vi/q-EW4-B11hw/hq720.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=\u0026rs=AOn4CLDih1gWupOjeCNOqccwA08iXuPTgQ","width":720,"height":404}]},"title":{
"runs":[{
"text":"STORMZY - SUPERHEROES"}],"accessibility":{
"accessibilityData":{
"label":"STORMZY - SUPERHEROES by Stormzy 10 hours ago 3 minutes, 47 seconds 318,366 views"}}},"descriptionSnippet":{
"runs":[{
"text":"STREAM/ DOWNLOAD \"SUPERHEROES\" NOW: https://stormzy.lnk.to/Superheroes\n\nSTREAM/ DOWNLOAD 'HEAVY IS THE HEAD' NOW: https://stormzy.lnk.to/HITH\n\nPRODUCTION COMPANY - COMPULSORY\nDIRECTOR - Taz..."}]},"longBylineText":{
"runs":[{
"text":"Stormzy","navigationEndpoint":{
BR Alex
|
|