Jump to content

Instagram Login (Web Requests)


nofire
 Share

Recommended Posts

Hi !

I'd like to connect to Iconosquare with HTTPRequests

But to connect to Iconosquare you need to connect to Instagram first (Iconosquare redirects you)

Once you connected to your instagram account it redirects you to Iconosquare

I got that already :

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")


$ConnectLink = 'https://instagram.com/oauth/authorize?client_id=d9494686198d4dfeb954979a3e270e5e&redirect_uri=http%3A%2F%2Ficonosquare.com&response_type=code&scope=likes+comments+relationships'
$ConnectLink2 = 'https://instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize%3Fclient_id%3Dd9494686198d4dfeb954979a3e270e5e%26redirect_uri%3Dhttp%253A%252F%252Ficonosquare.com%26response_type%3Dcode%26scope%3Dlikes%2Bcomments%2Brelationships'


$oHTTP.Open("GET",$ConnectLink,False)
$oHTTP.Send()

$oReceived = $oHTTP.ResponseText


$String = StringSplit($oReceived,'name="csrfmiddlewaretoken" value="',1)
$String2 = StringSplit($String[2],'"',1)

$Token = $String2[1]
$Cookie = $oHTTP.GetAllResponseHeaders

$sPD = "csrfmiddlewaretoken=" & $Token & "username=USERNAME&password=PASSWORD"
$oHTTP.Open("POST",$ConnectLink2,False)
$oHTTP.SetRequestHeader("Cookie","mid=VF-FtQAEAAH_rwL_DtMTOaq12uYs; csrftoken=" & $Token)
$oHTTP.SetRequestHeader("User-Agent","User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")

$oHTTP.Send($sPD)

$oReceived = $oHTTP.ResponseText
$Cookie = $oHTTP.GetAllResponseHeaders

$file = FileOpen("Received.html", 2)
FileWrite($file, $oReceived)
FileClose($file)

And I get that kind of error : 

This page could not be loaded. If you have cookies disabled in your browser, or you are browsing in Private Mode, please try enabling cookies or turning off Private Mode, and then retrying your action.

 

Do you have any ideas on how I could do that ?

Edited by nofire
Link to comment
Share on other sites

Also, for future's sake. Please wait 24 hours to bumb your own thread nofire. Thank you :)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...