Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System.Web
- Imports System.Text.RegularExpressions
- Imports System.IO
- Imports System.Text
- Public Class Form1
- Dim res As String
- 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"
- Dim cookies As String
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- cookies = TextBox1.Text
- GroupBox1.Enabled = True
- End Sub
- Public Function Approve_by_id(uesr_ID As String) As Boolean
- ' RXlib (Like Comment) Edit By @lwqz
- Try
- If (cookies.Length = 0) Then
- Return False
- Else
- Dim csrftoken As String = Regex.Match(cookies, "csrftoken=(.*?);").Groups(1).Value
- Dim postData As String = ""
- Dim tempcook As New CookieContainer
- Dim en As New UTF8Encoding
- Dim byteData As Byte() = en.GetBytes(postData)
- Dim httpPost = DirectCast(WebRequest.Create("https://www.instagram.com/web/friendships/" & uesr_ID & "/approve/"), HttpWebRequest)
- httpPost.Method = "POST"
- httpPost.KeepAlive = True
- httpPost.ContentType = "application/x-www-form-urlencoded"
- httpPost.UserAgent = user_agent
- httpPost.ContentLength = byteData.Length
- httpPost.Headers.Add("x-csrftoken", csrftoken)
- httpPost.Headers.Add("X-Instagram-AJAX", "1")
- httpPost.Headers.Add("x-requested-with", "XMLHttpRequest")
- httpPost.Headers.Add("Cookie", cookies)
- 'Send Data
- Dim poststr As Stream = httpPost.GetRequestStream()
- poststr.Write(byteData, 0, byteData.Length)
- poststr.Close()
- 'Get Response
- Dim POST_Response As HttpWebResponse
- POST_Response = DirectCast(httpPost.GetResponse(), HttpWebResponse)
- Dim Post_Reader As New StreamReader(POST_Response.GetResponseStream())
- Dim Response As String = Post_Reader.ReadToEnd
- res = Post_Reader.ReadToEnd
- If Response.Contains("{""status"": ""ok""}") Then
- Return True
- Else
- Return False
- End If
- End If
- Catch ex As Exception
- res = "Error !"
- Return False
- End Try
- End Function
- ' ما كملته والله كسل
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- Using w As New WebClient
- Dim listy As String
- w.Headers.Add("UserAgent", user_agent)
- w.Headers.Add("Cookie", cookies)
- listy = w.DownloadString("https://www.instagram.com/accounts/activity/?__a=1&include_reel=true")
- End Using
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- If Approve_by_id(TextBox2.Text) Then
- MsgBox("Done")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement