-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommentGrabberForm.vb
57 lines (53 loc) · 2.16 KB
/
CommentGrabberForm.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Imports DevComponents.DotNetBar
Public Class CommentGrabberForm
Public Sub scrapecomments()
Try
Dim theelementcollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
For Each curElement2 As HtmlElement In theelementcollection
If curElement2.GetAttribute("dir").Contains("ltr") Then
ListBox1.Items.Add(curElement2.InnerText)
End If
Next
Catch
End Try
ListBox1.Items.Remove(" BrowseUpload Create AccountSign In Search")
End Sub
Public Sub removedups()
Dim i, j As Integer
Dim Arr As New ArrayList
Dim ItemFound As Boolean
For i = 0 To ListBox1.Items.Count - 1
ItemFound = False
For j = 0 To i - 1
If ListBox1.Items.Item(i) = ListBox1.Items.Item(j) Then
ItemFound = True
Exit For
End If
Next j
If Not ItemFound Then
Arr.Add(ListBox1.Items.Item(i))
End If
Next i
ListBox1.Items.Clear()
ListBox1.Items.AddRange(Arr.ToArray)
Arr = Nothing
End Sub
Private Sub ButtonX3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX3.Click
WebBrowser1.Navigate(TextBoxX1.Text)
End Sub
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
scrapecomments()
removedups()
End If
End Sub
Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
Dim FileNumber As Integer = FreeFile()
FileOpen(FileNumber, "Comments1.txt", OpenMode.Output)
For Each Item As Object In ListBox1.Items
PrintLine(FileNumber, Item.ToString)
Next
FileClose(FileNumber)
MessageBoxEx.Show("Accounts Will Be Saved In The Same Spot Where You Have Youtube Bot!", "Comments Saved", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Class