Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim lst As New List(Of Serie)
- If alphabetic Then
- Dim json As String = GetSourceWithGet("http://url.endung/list.json) 'Holt den Quelltext mit einer GET-Anfrage und WebRequests
- json = json.Split("["c)(1).Split("]"c)(0)
- json = json.Replace(vbCrLf, "<NewLine>").Replace(vbCr, "<NewLine>").Replace(vbLf, "<NewLine>").Replace("<NewLine>", vbCrLf)
- json = json.Replace("{", "{" & vbCrLf).Replace("}", vbCrLf & "}" & vbCrLf).Replace(",""", "," & vbCrLf & """").Replace("}" & vbCrLf & ",{", "}," & vbCrLf & "{").Replace("\/", "/")
- Dim id As Integer = 0
- Dim name As String = ""
- Dim link As String = ""
- Dim cover As String = ""
- Dim background As String = ""
- Dim description As String = ""
- Dim trailer As String = ""
- Dim fsk As Integer = -1
- For Each line As String In json.Split({vbCrLf}, StringSplitOptions.RemoveEmptyEntries)
- If line.StartsWith("""id""") Then
- id = Integer.Parse(line.Substring(Len("""id"":")).Replace(",", ""))
- End If
- If line.StartsWith("""name""") Then
- name = line.Substring(Len("""name"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""link""") Then
- link = line.Substring(Len("""link"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""cover""") Then
- cover = line.Substring(Len("""cover"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""background""") Then
- background = line.Substring(Len("""background"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""description""") Then
- description = line.Substring(Len("""description"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""trailer""") Then
- trailer = line.Substring(Len("""trailer"":""")).Replace(""",", "")
- End If
- If line.StartsWith("""fsk""") Then
- fsk = Integer.Parse(line.Substring(Len("""fsk"":")))
- lst.Add(New Serie(id, ReplaceUnicode(name), link, "http://url.endung" & cover, "http://url.endung" & background, ReplaceUnicode(description), trailer, fsk))
- 'ReplaceUnicode ersetzt \u in &H und führt ChrW(CharCode) aus
- End If
- Next
- End If
- Return lst.ToArray
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement