teamplaylotto Posted September 2, 2007 Share Posted September 2, 2007 Hi, I've searched and searched but I can't find a way around this.. I've written a script that logs in to my site with my details and stores the cookie, that works no problem, I can visit another page on my site with the cookie and parse the page that is given, the result I get tells me that curl saw a page that is only shown to a logged in user. once I do that, I want to visit a url that I parsed from the page using the same cookie but the url I visit has a javascript tracker on it, I want the tracker to 'know' I've been there but since curl doesn't execute javascript, the tracker doesn't get called by the javascript in the html that I parse. I have live http headers plugin and can see what url's the javascript makes a call to so I tried setting the url to that and passing the cookie data but the tracker doesn't show the visit made by the script posing as me. am I missing something obvious? I'm pretty sure the javascript call for the tracker tries to see if a cookie is held by the surfer, if it is, it logs the visit. anyone have any experience with this? regards Andy Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 2, 2007 Share Posted September 2, 2007 javascript works in a browser curl requests are sent between firefox and they are 'direct' connections between the servers the servers don't execute any javascript because javascript is designed to control userinteraction on a web page - as there is no need for any of that it doesn't get executed. Quote Link to comment Share on other sites More sharing options...
btherl Posted September 3, 2007 Share Posted September 3, 2007 It's hard to tell without knowing anything about the tracker. Do you set the user agent in curl to a browser user agent? Quote Link to comment Share on other sites More sharing options...
teamplaylotto Posted September 3, 2007 Author Share Posted September 3, 2007 thanks for your response btherl, I am setting the user agent to to the same as if I was browsing myself, maybe I need to play with it a bit more. the tracking script is similar to google analytics but it only regisiters a hit if the person visiting has a cookie from the members site. I'll see what I can do with some more searching! Andy Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 3, 2007 Share Posted September 3, 2007 Christ my post was awful!!!! terrible english (I was tired). try again - basically a curl request happens between the 2 servers - no matter what client you are using it is the 2 servers performig this transaction NOT the client. Ergo the javascript you are using as a tracker will NOT get executed - you will have to pass ALL teh infomation you want processed (like your id etc.) in the curl headers so that the processing script has all the data it needs to do checks calcs etc... Quote Link to comment Share on other sites More sharing options...
teamplaylotto Posted September 3, 2007 Author Share Posted September 3, 2007 hehe toonmariner, your reply was the first thing I read when I got up this morning and my first thought was WTF? lol thanks for making it clear(er) problem solved! I had much reading of curly things today and after muchos experimenting and viewing of live http headers and comparing that to other headers sent by using different accounts, I have managed to find the url the javascript calls to log the tracking. It was then a simple matter to set cookie, referrer and adding a timestamp before doing a curl_exec to the tracking url. thanks for your help! Andy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.