Quote: Dim xDoc = XDocument.Load(feedUrl) 'For Each category In xDoc.Descendants("category") ' ' Try ' Dim lName As String = category.Attribute("name").Value ' Dim leagueName() As String ' leagueName = Split(lName, ":", 2) ' Dim leagueId As String = category.Attribute("id").Value ' Dim minutesToExpiry As Int16 = 5 ' For Each match In xDoc.Descendants("match") ' 'Try ' Dim matchId As Integer = Val(match.Attribute("id").Value) ' Dim matchDate As DateTime = CDate(String.Format("{0}/{1}/{2} {3}", _ ' match.Attribute("date").Value.Split(" ")(1), _ ' match.Attribute("date").Value.Split(" ")(0), _ ' match.Attribute("formatted_date").Value.Split(".")(2), _ ' match.Attribute("time").Value)) ' matchDate = matchDate.AddHours(1) ' GMT + 1 ' Dim match_formdate As Date = match.Attribute("formatted_date").Value ' Dim match_time As Date = match.Attribute("time").Value ' Dim gsm_id As Integer = match.Attribute("fix_id").Value ' Dim matchStatus As String = match.Attribute("status") ' Dim homeId As String = match.Descendants("localteam")(0).Attribute("id").Value ' If homeId = "" Then ' homeId = 0 ' End If ' Dim homeTeamId As Integer = CInt(homeId) ' Dim homeTeam As String = match.Descendants("localteam")(0).Attribute("name").Value ' Dim awayId As String = match.Descendants("visitorteam")(0).Attribute("id").Value ' If awayId = "" Then ' awayId = 0 ' End If ' Dim awayTeamId As Integer = CInt(awayId) ' Dim awayTeam As String = match.Descendants("visitorteam")(0).Attribute("name").Value ' Dim uniqueId As String = String.Format("{0:yyyyMMddHHss}{1}{2}", matchDate, homeTeamId, awayTeamId) ' Dim expiryDate As DateTime = matchDate.AddMinutes(-1 * minutesToExpiry) ' Dim entby As String = "user" ' If match.Descendants("localteam")(0).Attribute("goals").Value.Length > 0 Then ' Dim homeTeamScor As String = match.Descendants("localteam")(0).Attribute("goals").Value ' Dim awayTeamScor As String = match.Descendants("visitorteam")(0).Attribute("goals").Value ' If homeTeamScor = "?" Then ' homeTeamScor = "0" ' End If ' If awayTeamScor = "?" Then ' awayTeamScor = "0" ' End If ' homeTeamScore = CInt(homeTeamScor) ' awayTeamScore = CInt(awayTeamScor) ' End If ' If match.Descendants("events").Elements.Count > 0 Then ' End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)