pileot Posted March 4, 2008 Posted March 4, 2008 (edited) A friend helped me get the following:$oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oUsername = " " $oPassword = " " $oHTML = HTTPRequest("POST", "https://login.facebook.com/login.php", "email=" & $oUsername & "&pass=" & $oPassword) sleep(5000) ConsoleWrite($oHTML & @CRLF) ;$oHTTP.Open("GET", $address) ;$oHTTP.Send() ;more content goes here Func HTTPRequest($oMethod, $oURL, $oData = "") $oHTTP.Open($oMethod, $oURL, False) If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($oData) Return $oHTTP.ResponseText EndFuncThe problem is facebook uses java javascript cookies (if that makes sense) so this was not logging in correctly. Unfortunately my friend had to leave, so im stranded, and not totally sure what im doing here...Basically, i want this program to log in facebook, check on my profile page (hence the $oHTTP.Open("GET", $address) bit) and pop up a msgbox if theres any messages in the inbox. I might expand it for other events, and other things, but for now this is what i want.I could do this with a IE client, but i want to be able to do this without a client, which is why were using the httprequest stuff...Anyone game for not only helping the script, but assisting me learn what the added parts to the script do? Having the solution is one thing, but having the knowledge how to solve this problem in the future is another...Help?EditYes, IE would be a whole lot easier, will take less time, and probabally work better. i dont care. I want to have it work without IE. Thanks for the suggestions about how to do it with IE but they dont really apply because thats not what im doing. So please dont post about IE here. Thanks.Also fixed javascript cookies, not java. my bad.Editok according to Azkay (the friend helping me with this) you cant get javascript through httprequest, because javascript runs through the browser, so i would have to figure out how it makes the cookies to get anywhere further with this.So anyone out there know much about javascript? Edited March 4, 2008 by pileot
igotandrew Posted March 4, 2008 Posted March 4, 2008 I'm pretty new to the whole AutoIt scene, but let me know if you make any progress. I'd very much like to see the end result. Keep me posted.
pileot Posted March 4, 2008 Author Posted March 4, 2008 another feature i would like to eventually add is checking the page that says which friends are active, and if a specific friend goes active it pops another message...
Moderators SmOke_N Posted March 4, 2008 Moderators Posted March 4, 2008 Why not (please explain) just use _IE* functions if you "know" they'll work and hide the IE client? ... No sense in beating yourself up if you can do it a different way with the same look and output. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
pileot Posted March 4, 2008 Author Posted March 4, 2008 (edited) SmOke_N said: Why not (please explain) just use _IE* functions if you "know" they'll work and hide the IE client? ... No sense in beating yourself up if you can do it a different way with the same look and output.i could.... and did....but the thing is i hate IE.Wish a passion.And i quite often have over 20 different apps running, i would rather have my computer resources free for other things instead of having IE suck those resources. (Ie is currently sucking about 100k of my system memory) Also with all my programs running i have a tendancy to close windows that are not being used... i inadvertantly close the IE wondow more often than i remember not to....yeah i *could* do it the easy way, but if i can get it running this way it would be that much more awesome. Edited March 4, 2008 by pileot
igotandrew Posted March 4, 2008 Posted March 4, 2008 Apply the KISS Rule then advance, Otherwise your gonna have a lot of idle time on your hands. Uh, I was working on something like this a while ago. I know a bit of the ie.au3 functions so ask if you need help!
ResNullius Posted March 4, 2008 Posted March 4, 2008 pileot said: Also with all my programs running i have a tendancy to close windows that are not being used... i inadvertantly close the IE wondow more often than i remember not to....yeah i *could* do it the easy way, but if i can get it running this way it would be that much more awesome. SmOke_N said: Why not (please explain) just use _IE* functions if you "know" they'll work and hide the IE client? ... No sense in beating yourself up if you can do it a different way with the same look and output.If you can close a hidden IE window inadvertently then you do have a problem!When you said you made an IE solution, either you must have automated a standard browser seesion or you missed the "visible" parameter in _IECreate()Like SmOke_N said, check out the _IE* functions in the UDFs.
pileot Posted March 4, 2008 Author Posted March 4, 2008 lol thanks for the response... yes i know its easier to use IE, KISS, etc. But i was hoping to find a way to do it this way... Anyone have suggestions how to do it without IE?
AzKay Posted March 4, 2008 Posted March 4, 2008 To clear things up. Facebook uses javascript to make the cookie, He does not want to use IE, Because he doesnt want IE running. Thus, httprequests. # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Bert Posted March 4, 2008 Posted March 4, 2008 Autoit doesn't support Firefox in the same sence it supports IE. (No way to hook into stuff) Your stuck using IE. I understand you hate it, but it will do what you need it to do. The Vollatran project My blog: http://www.vollysinterestingshit.com/
pileot Posted March 4, 2008 Author Posted March 4, 2008 (edited) Volly said: Autoit doesn't support Firefox in the same sence it supports IE. (No way to hook into stuff) Your stuck using IE. I understand you hate it, but it will do what you need it to do.Sigh.... Im not asking for firefox support...the httprequest fuctions dont use any browsers... they work a LOT faster than any IE scripts could work (because they dont need to download any images or anything) they use a lot less bandwith, and are overall better, especially if your not interested in watching a script work.I dont know how else to say it. Im trying to use this script for browserless surfing. No IE, no Firefox....EditProject halted, Apparently httprequests cant deal with javascript as its a browser thing... For this to work we need to know how javascript creates the cookies used for facebook. So untill then, its halted. :/ Edited March 4, 2008 by pileot
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now