Advertisement
339r

& uesr_ID & "/approve/

Oct 11th, 2019
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Net
  2. Imports System.Web
  3. Imports System.Text.RegularExpressions
  4. Imports System.IO
  5. Imports System.Text
  6.  
  7. Public Class Form1
  8.     Dim res As String
  9.     Dim user_agent As String = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
  10.     Dim cookies As String
  11.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  12.         cookies = TextBox1.Text
  13.         GroupBox1.Enabled = True
  14.     End Sub
  15.     Public Function Approve_by_id(uesr_ID As String) As Boolean
  16.         ' RXlib (Like Comment) Edit By @lwqz
  17.        Try
  18.  
  19.             If (cookies.Length = 0) Then
  20.                 Return False
  21.             Else
  22.  
  23.                 Dim csrftoken As String = Regex.Match(cookies, "csrftoken=(.*?);").Groups(1).Value
  24.                 Dim postData As String = ""
  25.                 Dim tempcook As New CookieContainer
  26.                 Dim en As New UTF8Encoding
  27.                 Dim byteData As Byte() = en.GetBytes(postData)
  28.  
  29.                 Dim httpPost = DirectCast(WebRequest.Create("https://www.instagram.com/web/friendships/" & uesr_ID & "/approve/"), HttpWebRequest)
  30.  
  31.                 httpPost.Method = "POST"
  32.                 httpPost.KeepAlive = True
  33.                 httpPost.ContentType = "application/x-www-form-urlencoded"
  34.                 httpPost.UserAgent = user_agent
  35.                 httpPost.ContentLength = byteData.Length
  36.                 httpPost.Headers.Add("x-csrftoken", csrftoken)
  37.                 httpPost.Headers.Add("X-Instagram-AJAX", "1")
  38.                 httpPost.Headers.Add("x-requested-with", "XMLHttpRequest")
  39.                 httpPost.Headers.Add("Cookie", cookies)
  40.  
  41.                 'Send Data
  42.                Dim poststr As Stream = httpPost.GetRequestStream()
  43.                 poststr.Write(byteData, 0, byteData.Length)
  44.                 poststr.Close()
  45.  
  46.                 'Get Response
  47.                Dim POST_Response As HttpWebResponse
  48.                 POST_Response = DirectCast(httpPost.GetResponse(), HttpWebResponse)
  49.  
  50.  
  51.                 Dim Post_Reader As New StreamReader(POST_Response.GetResponseStream())
  52.                 Dim Response As String = Post_Reader.ReadToEnd
  53.                 res = Post_Reader.ReadToEnd
  54.  
  55.                 If Response.Contains("{""status"": ""ok""}") Then
  56.                     Return True
  57.                 Else
  58.                     Return False
  59.                 End If
  60.             End If
  61.  
  62.  
  63.         Catch ex As Exception
  64.             res = "Error !"
  65.             Return False
  66.         End Try
  67.     End Function
  68.     ' ما كملته والله كسل
  69.    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  70.         Using w As New WebClient
  71.             Dim listy As String
  72.             w.Headers.Add("UserAgent", user_agent)
  73.             w.Headers.Add("Cookie", cookies)
  74.             listy = w.DownloadString("https://www.instagram.com/accounts/activity/?__a=1&include_reel=true")
  75.         End Using
  76.     End Sub
  77.  
  78.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  79.         If Approve_by_id(TextBox2.Text) Then
  80.             MsgBox("Done")
  81.         End If
  82.     End Sub
  83. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement