Login   Register  
PHP Classes
elePHPant
Icontem

File: deny_buddy.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of philongxp  >  YMSG16  >  deny_buddy.php  >  Download  
File: deny_buddy.php
Role: Example script
Content type: text/plain
Description: Delete your ID in buddy list
Class: YMSG16
YMSG16 send message, deny buddy, status checker
Author: By
Last change: Change port 5050 to 80
Date: 2010-05-11 23:28
Size: 2,066 bytes
 

Contents

Class file image Download
<?php    
    $uid    
"";    // Bot ID
    
$pwd    "";    // Bot Pwd
    
$target    "";    // TargetID
    
    
include 'YMSG.class.php';    // YMSG Protocol Class
    
$ymsg = new YMSG();

    
// Connect to server
    
$server    file_get_contents('http://vcs1.msg.yahoo.com/capacity');
    
$server    substr($serverstrpos($server"CS_IP_ADDRESS=") + strlen("CS_IP_ADDRESS="));
    
$fp fsockopen($server80$errno$errstr2) or die('Cannot connect!!!');    
    if (
$fp != null)
    {
        
stream_set_timeout($fp1); 
    }
    
    
// Create Deny Buddy Packet
    
$denyBuddy    $ymsg->denyBuddy($uid$target"You've been removed");
        
    
// Create preConnect Packet
    
$preChk $ymsg->preCheck();
    
fwrite($fp$preChk);    
    
    
// Preconnect result
    
$chkStr     fread($fp20);
    
    if (
$ymsg->getPacketType($chkStr) == 'L')
    {
        print 
'Precheck success!!!<br/>';    
        
        
// Create Challenge Request Packet
        
$chkStr $ymsg->getChallenge($uid);
        
fwrite($fp$chkStr);
        
$chlStr fread($fp150);
    }
    
    if (
$ymsg->getPacketType($chkStr) == 'W')
    {
        print 
'Challenge Succes!!!<br/>';
        
        
// Get Status and Challenge String from Server Response
        
$status     $ymsg->parseToken($chlStr"13".$ymsg->sepStrchr(0xC0));
        
$challenge     $ymsg->parseToken($chlStr"94".$ymsg->sepStrchr(0xC0));
        
        
// Get and Parse Login Cookie Info
        
$info        $ymsg->getLoginInfo($uid$pwd$challenge);
        
$crumb        $ymsg->parseToken($info"crumb="chr(0xD));
        
$T            $ymsg->parseToken($info"T="chr(0xD));
        
$Y            $ymsg->parseToken($info"Y="chr(0xD));
        
        
// Create Login Packet
        
$loginStr    $ymsg->Login($uid$challenge$Y$T$crumbtrue);    
        
fwrite($fp$loginStr);
        
        
// Login Result
        
$loginRes    fread($fp1024);
    }
    
    if (
$ymsg->getPacketType($loginRes) == 'U')
    {
        print 
'Login Succes!!!<br/>';    
        
        
// Account info: Friend List, Ignore List, etc...
        
$nextData '';
        do {
            
$nextData fread($fp500);
        } while (
strlen($nextData) > 0);
    }

    
// Login Done
    
print 'Deny Buddy!!!<br/>';    
    
fwrite($fp$denyBuddy);
    
$result fread($fp1024);
?>