Advertisement
AhmedSokr

Untitled

Nov 19th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. Imports System.IO
  2. Imports System.Net
  3. Imports System.Text.RegularExpressions
  4. Imports System.Threading
  5. Imports OpenQA.Selenium
  6. Imports OpenQA.Selenium.Chrome
  7. Imports SMM_CONTROLS.iTalk
  8.  
  9. Public Class ManagePage
  10. Private drv1 As ChromeDriver
  11. Private chromeOptions As ChromeOptions
  12. Dim C As Integer = 0
  13. Private Sub GroupBox2_Enter(sender As Object, e As EventArgs)
  14.  
  15. End Sub
  16.  
  17. Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs)
  18.  
  19. End Sub
  20.  
  21.  
  22. Dim JustLog As System.Threading.Thread
  23. Private Sub BunifuThinButton22_Click(sender As Object, e As EventArgs)
  24.  
  25. End Sub
  26.  
  27. Private Sub Button1_Click(sender As Object, e As EventArgs)
  28. 'ListBox2.Items.Add(ListBox1.Text)
  29. 'ListBox1.Items.Clear()
  30. End Sub
  31. Private Sub BunifuThinButton25_Click_1(sender As Object, e As EventArgs) Handles BunifuThinButton25.Click
  32. Try
  33. Dim chromeDriverService As ChromeDriverService = ChromeDriverService.CreateDefaultService()
  34. Me.chromeOptions = New ChromeOptions()
  35. chromeDriverService.HideCommandPromptWindow = True
  36. Control.CheckForIllegalCrossThreadCalls = False
  37. ServicePointManager.DefaultConnectionLimit = Integer.MaxValue
  38. Dim drv As ChromeDriver = New ChromeDriver(chromeDriverService, chromeOptions)
  39.  
  40. drv1 = drv
  41. drv1.Navigate().GoToUrl("https://mbasic.facebook.com/")
  42. login()
  43. Catch ex As Exception
  44.  
  45. End Try
  46. End Sub
  47. Private Sub login()
  48. Try
  49. drv1.FindElement(By.Id("m_login_email")).SendKeys(Email.Text)
  50. drv1.FindElement(By.Name("pass")).SendKeys(Pass.Text)
  51. drv1.FindElement(By.Name("login")).Click()
  52. Catch ex As Exception
  53.  
  54. End Try
  55.  
  56. End Sub
  57. Private Sub send()
  58.  
  59.  
  60.  
  61. End Sub
  62.  
  63. Private Sub BunifuThinButton26_Click(sender As Object, e As EventArgs) Handles BunifuThinButton26.Click
  64. ListBox2.Items.Clear()
  65. Dim openfile = New OpenFileDialog()
  66. openfile.Filter = "Text (*.txt)|*.txt"
  67. If (openfile.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
  68. Dim myfile As String = openfile.FileName
  69. Dim allLines As String() = File.ReadAllLines(myfile)
  70. For Each line As String In allLines
  71. ListBox2.Items.Add(line)
  72. Next
  73. End If
  74. Label6.Text = "Numbers Of Ids" + ListBox2.Text.Count.ToString()
  75. End Sub
  76.  
  77. Private Sub BunifuThinButton24_Click(sender As Object, e As EventArgs) Handles BunifuThinButton24.Click
  78. Dim s As SaveFileDialog = New SaveFileDialog()
  79. s.Title = "Save Members"
  80. s.FileName = "Page IDs"
  81. s.Filter = "Text files (*.txt)|*.txt"
  82. If s.ShowDialog() = DialogResult.OK Then
  83. For i = 0 To ListBox1.Items.Count - 1
  84. ListBox1.SelectedItem = ListBox1.Items(i)
  85. Dim tw As TextWriter = New StreamWriter(s.FileName, True)
  86. tw.WriteLine(ListBox1.SelectedItems)
  87. tw.Close()
  88. Next
  89. ListBox1.Items.Clear()
  90. End If
  91. End Sub
  92.  
  93. Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
  94. TextBox1.Text += "<3"
  95. End Sub
  96.  
  97. Private Sub BunifuThinButton22_Click_1(sender As Object, e As EventArgs) Handles BunifuThinButton22.Click
  98. ListBox1.Items.Clear()
  99. Dim WebClinet1 As New Net.WebClient()
  100. WebClinet1.Encoding = System.Text.Encoding.UTF8
  101. Dim Content As String = Regex.Unescape(WebClinet1.DownloadString("https://graph.facebook.com/v5.0/" + Page_ID.Text + "/conversations?access_token=" + Page_access.Text + "&debug=all&fields=id&format=json&limit=" + limit.Text + "&method=get&pretty=0&suppress_http_code=1&transport=cors"))
  102. Dim StrArray() As String = Regex.Split(Content, "{")
  103. For i As Integer = 1 To StrArray.Length - 1
  104. Dim FirstCol2 As String = Regex.Match(StrArray(i), """id"":""t_(.+?)""").Groups(1).Value
  105. ListBox1.Items.Add(FirstCol2)
  106. Next
  107. End Sub
  108. Sub listingarea()
  109.  
  110. End Sub
  111.  
  112. Private Sub BunifuThinButton27_Click(sender As Object, e As EventArgs) Handles BunifuThinButton27.Click
  113. drv1.Navigate().GoToUrl("https://www.facebook.com/OF.Hamsa/inbox/?mailbox_id=1684949355067687&selected_item_id=" + ListBox2.Text)
  114. C += 1
  115. ListBox2.SelectedItem = ListBox2.Items(C - 1)
  116. Timer1.Start()
  117. End Sub
  118.  
  119. Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  120.  
  121. Try
  122. Thread.Sleep(2000)
  123. drv1.FindElement(By.CssSelector("textarea[class='_1p7p _5id1 _4dv_ _58al uiTextareaAutogrow']")).SendKeys(TextBox1.Text + Keys.Enter)
  124. Thread.Sleep(2000)
  125. 'Thread.Sleep(TextBox8.Text * 1000)
  126. Timer1.Stop()
  127. Timer2.Start()
  128. Catch ex As Exception
  129. MsgBox(ex.Message)
  130. End Try
  131. End Sub
  132.  
  133. Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
  134. drv1.Navigate().GoToUrl("https://www.facebook.com/OF.Hamsa/inbox/?mailbox_id=1684949355067687&selected_item_id=" + ListBox2.Text)
  135. C += 1
  136. ListBox2.SelectedItem = ListBox2.Items(C - 1)
  137. Timer2.Stop()
  138. Timer1.Start()
  139. End Sub
  140. Sub DisposeTimer()
  141. Timer1.Stop()
  142. Timer2.Stop()
  143. End Sub
  144.  
  145. Private Sub BunifuThinButton28_Click(sender As Object, e As EventArgs) Handles BunifuThinButton28.Click
  146. DisposeTimer()
  147. End Sub
  148.  
  149. Private Sub BunifuThinButton23_Click_1(sender As Object, e As EventArgs) Handles BunifuThinButton23.Click
  150. Dim WebClinet1 As New Net.WebClient()
  151. WebClinet1.Encoding = System.Text.Encoding.UTF8
  152. Dim Content As String = Regex.Unescape(WebClinet1.DownloadString("https://graph.facebook.com/" + PageID.Text + "?fields=access_token&access_token=" + Token.Text + ""))
  153. Dim StrArray() As String = Regex.Split(Content, "{")
  154. For i As Integer = 1 To StrArray.Length - 1
  155. Dim FirstCol As String = Regex.Match(StrArray(i), "access_token"":""(.+?)""").Groups(1).Value
  156. ITalk_RichTextBox1.Text = "Token : " + FirstCol
  157. Next
  158. End Sub
  159. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement