Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region "Non-API"
- Private Sub NonAPI_ProcessCalls()
- Dim PITS = Utilities.HTTP("http://www.wccca.com/PITSv2/Default.aspx", "POST", "__viewstate=") ' WCCCAs Exploit
- If PITS = "ERROR" = False Then
- ' Process WCCCA/CCOM Calls list and filter the end rest of the document then turn it into an array!
- Dim WCCCA = Split(Utilities.processMarkers(Utilities.dtrim(Utilities.dtrim(PITS, "<div id=""ccom-main"" class=""main"">", 1), "<div id=""wccca-incidents"" class=""incidents"">", 0)), "Call Type: ")
- Dim CCOM = Split(Utilities.processMarkers(Utilities.dtrim(Utilities.dtrim(PITS, "<div id=""divTools"">", 1), "<div id=""ccom-incidents"" class=""incidents"">", 0)), "Call Type: ")
- PraseCalls(WCCCA, "W", PITS)
- PraseCalls(CCOM, "C", PITS)
- Else
- Throw New Exception("Error: Cannot load WCCCA PITs data")
- End If
- End Sub
- Private Sub PraseCalls(ByVal ARR As String(), county As String, PITS As String)
- If ARR.Length > 0 Then
- For i As Integer = 0 To ARR.Count - 1
- If String.IsNullOrWhiteSpace(ARR(i)) = False Then
- Dim [call] As New Oregon_911_Mainframe.calls
- [call].setCounty(county)
- [call].setGUID(Trim(Utilities.txtDelete(Utilities.txtDelete(Utilities.dtrim(Utilities.dtrim(ARR(i), "Time:", 1), "GUID: ", 0), "Time:"), "GUID: ").ToString.ToUpper))
- [call].setCallType(Utilities.txtDelete(Utilities.dtrim(ARR(i), " Address:", 1), " Address:").ToString.ToUpper)
- [call].setAddress(Trim(Utilities.txtDelete(Utilities.txtDelete(Utilities.dtrim(Utilities.dtrim(ARR(i), "Address:", 0), " GUID:", 1), "Address: "), " GUID:").ToString.ToUpper))
- Dim TMP = Utilities.txtDelete(Utilities.dtrim(ARR(i), "Time: ", 0), "Time: ").ToString.Split(" ")
- Dim TIME_TMP As New List(Of String)
- For index As Integer = 0 To 4
- If Not String.IsNullOrWhiteSpace(TMP(index)) Then
- If TMP(index) = "--:--:--" Then
- TIME_TMP.Add("00:00:00")
- Else
- TIME_TMP.Add(TMP(index))
- End If
- End If
- Next
- [call].setTime(TIME_TMP)
- [call].setAgency(Utilities.txtDelete(TMP(6), "/"), useAPI)
- [call].setStation(Utilities.txtDelete(TMP(6), " "))
- [call].setUnits(Trim(Utilities.txtDelete(dtrim(ARR(i), "Units: ", 0), "Units: ")))
- [call].setPriority("LOW")
- [call].setType("UNK")
- Dim GEO_STRING = Utilities.dtrim(Utilities.dtrim(PITS, "LoadMarker(parseFloat(", 0), "updateMarkers();", 1).ToString.Split("LoadMarker(")
- For Each item In GEO_STRING
- If Not String.IsNullOrWhiteSpace(item) Then
- Dim GEO_INFO = Utilities.dtrim(item, ";", 1).ToString.Split("', '")
- If Trim(Utilities.txtDelete(GEO_INFO(3), "'")) = [call].getGUID Then
- Dim Geo As New List(Of Double)
- If county = "W" Then
- If GEO_INFO(5).Contains("wccca") Then
- GEO_INFO = GEO_INFO(0).ToString.Split(",")
- Geo.Add(Trim(Utilities.txtDelete(Utilities.txtDelete(GEO_INFO(0), "oadMarker(parseFloat("), ")")))
- Geo.Add(Trim(Utilities.txtDelete(Utilities.txtDelete(GEO_INFO(1), "parseFloat("), ")")))
- End If
- Else
- If GEO_INFO(5).Contains("ccom") Then
- GEO_INFO = GEO_INFO(0).ToString.Split(",")
- Geo.Add(Trim(Utilities.txtDelete(Utilities.txtDelete(GEO_INFO(0), "oadMarker(parseFloat("), ")")))
- Geo.Add(Trim(Utilities.txtDelete(Utilities.txtDelete(GEO_INFO(1), "parseFloat("), ")")))
- End If
- End If
- [call].setGeo(Geo)
- End If
- End If
- Next
- AddOrUpdateCall([call])
- End If
- Next
- End If
- End Sub
- Private Sub NonAPI_PraseUnits()
- For Each incident In database
- Dim temp = ""
- Dim Unit_HTML = Utilities.HTTP("http://www.wccca.com/PITSv2/units.aspx?cn=" & incident.getGUID & "&a=" & incident.getCounty.ToString.ToLower & "&ct=OR911_IMPORT", "POST", "")
- If Unit_HTML = "ERROR" = False Then
- If Unit_HTML Is Nothing = False Then
- Dim doc As New HtmlDocument()
- doc.LoadHtml(Unit_HTML)
- For Each table As HtmlNode In doc.DocumentNode.SelectNodes("//table")
- For Each row As HtmlNode In table.SelectNodes("tr")
- temp += incident.getGUID & " " & incident.getCounty & " "
- For Each cell As HtmlNode In row.SelectNodes("th|td")
- If cell.InnerText = "Unit" = False And cell.InnerText = "Dispatch" = False And cell.InnerText = "En Route" = False And cell.InnerText = "On Scene" = False And cell.InnerText = "Clear" = False Then
- If String.IsNullOrWhiteSpace(cell.InnerText) = False Then
- temp += cell.InnerText.Replace(" ", "00:00:00") & " "
- End If
- End If
- Next
- temp += vbNewLine
- Next
- Next
- End If
- End If
- Dim temp_split = temp.Split(vbCrLf)
- For i As Integer = 1 To temp_split.Length - 2
- Dim UNIT_INFO = Utilities.txtDelete(temp_split(i), vbLf).ToString.Split(" ")
- If UNIT_INFO(0) = incident.getGUID And UNIT_INFO(1) = incident.getCounty Then
- Dim UNIT As New Oregon_911_Mainframe.units
- UNIT.setGUID(UNIT_INFO(0))
- UNIT.setCounty(UNIT_INFO(1))
- Dim Time As New List(Of String)
- For Index As Integer = 3 To 6
- Time.Add(UNIT_INFO(Index))
- Next
- UNIT.setTime(Time)
- UNIT.setUnit(UNIT_INFO(2))
- AddOrUpdateUnit(incident, UNIT)
- End If
- Next
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement