RosettaCodeData/Task/Web-scraping/Yabasic/web-scraping-2.basic
2026-04-30 12:34:36 -04:00

25 lines
702 B
Text

// Read file line by line
open "utctime.html" for reading as #1
sContent$ = ""
while not eof(1)
line input #1 linea$
sContent$ = sContent$ + linea$ + chr$(10)
wend
close #1
utcStart = instr(sContent$, "UTC</td><td>")
if utcStart > 0 then
utcStart = utcStart + 12
utcEnd = instr(sContent$, "</td>", utcStart)
if utcEnd > 0 sUTC$ = trim$(mid$(sContent$, utcStart, utcEnd - utcStart))
end if
rfcStart = instr(sContent$, "RFC 850</td><td>")
if rfcStart > 0 then
rfcStart = rfcStart + 16
rfcEnd = instr(sContent$, "</td>", rfcStart)
if rfcEnd > 0 sRFC850$ = trim$(mid$(sContent$, rfcStart, rfcEnd - rfcStart))
end if
print "UTC: ", sUTC$
print "RFC 850: ", sRFC850$