myspace tracking
Posted: Fri Apr 21, 2006 1:57 pm
hello all.
i'm trying to write a tracking script for myspace, but i'm affraid myspace is outsmarting me.
database saving is easy. it's a bit of work but nothing i can't do.
anyway, that's not the chalenge so for now, i'm using files to log.
but here's the thing:
how to get the info from myspace?
right now, i named my php script image.jpg and use it as an image on my myspace page.
basicly this is what it does:
(oh yeah, my htaccess does a forcetype, it works 
so, when the myspace page loads, the image is loaded and a line is added to the log
first thing is stupid, i know it won't work because that would be a huge security problem, but i couldn't resist trying it anyway, hehe.
so anyway, i can save the ip and the url of the page, but that doesn't really contain any info i can use.
i checked and the mail addres of the user is saved in the session under the name "ME" (that's why i tried saving that)
so i need a way to get the content of that value. once i have that, i can run a search for that emailaddres and i'll be able to find the profile of the user visiting my page...
any ideas?
i'm trying to write a tracking script for myspace, but i'm affraid myspace is outsmarting me.
database saving is easy. it's a bit of work but nothing i can't do.
anyway, that's not the chalenge so for now, i'm using files to log.
but here's the thing:
how to get the info from myspace?
right now, i named my php script image.jpg and use it as an image on my myspace page.
basicly this is what it does:
Code: Select all
<?php
$handle = fopen("log.txt","a");
fwrite($handle,"myspace name: " . $_SESSION["ME"] . ", ip: " . $_SERVER["REMOTE_ADDR"] . ", ref: ". $_SERVER["HTTP_REFERER"]."\n");
fclose($handle);
header('Content-type: image/gif');
@readfile("pixel.gif");
?>so, when the myspace page loads, the image is loaded and a line is added to the log
first thing is stupid, i know it won't work because that would be a huge security problem, but i couldn't resist trying it anyway, hehe.
so anyway, i can save the ip and the url of the page, but that doesn't really contain any info i can use.
i checked and the mail addres of the user is saved in the session under the name "ME" (that's why i tried saving that)
so i need a way to get the content of that value. once i have that, i can run a search for that emailaddres and i'll be able to find the profile of the user visiting my page...
any ideas?