In what way can I read all the jpg files that are in a certain remote folder?
I think in this Sub you should do it
I think in this Sub you should do it
B4X:
Public Sub FindImages (root As String) As ResumableSub
Dim j As HttpJob
j.Initialize("", Me)
j.Download(root)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim str As String = j.GetString
Dim rb As RegexBuilder
rb.Initialize
rb.AppendEscaped("<img").Append(rb.CharAny).AppendZeroOrMore.AppendEscaped($"src=""$).StartCapture
rb.AppendAnyBut(Array($"""$)).AppendAtLeastOne.EndCapture.Append(rb.CharQuote)
Log(rb.Pattern)
Dim m As Matcher = Regex.Matcher2(rb.Pattern, Regex.MULTILINE, str)
Do While m.Find
Dim link As String = m.Group(1)
If link.StartsWith("http") = False Then
If link.StartsWith("/") = False Then link = "/" & link
link = root & link
End If
Main.urls.Add(link)
Loop
End If
j.Release
Return j.Success
End Sub