i want to make a script to delete the 25,000+ friends as manual deletion has taken forever and i am still no where near done. i have a script to login to Myspace, and a friend help’d with some JavaScript to select the “select All” box, i am just unsure how i would go from logging in to the friends page without actually changing domains or pages. i figured an iframe or simular.
the following login script was not written by me.
[php]
class Myspace
{
function login($username, $password)
{
$username = $_POST[‘user’];
$password = $_POST[‘passwd’];
$login_url = "https://secure.myspace.com/index.cfm?fuseaction=login.process";
$post_data = "ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Email_Textbox=$username&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Password_Textbox=$password";
$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) ");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
}
}
if(@$_POST[‘user’] && @$_POST[‘passwd’])
{
$login = new Myspace;
echo $login->login($_POST['user'],$_POST['passwd']);
}
else
{
echo
"
</form>
</body>
</html>";
}
[/php]
and the java script to check the select all button.
for(i in a=documents.getElementsByTagName('input'))
if(a[i].type="checkbox") a.checked = true;