Changeset 11471

Show
Ignore:
Timestamp:
08/03/07 12:44:09 (1 year ago)
Author:
juhana
Message:

Moved example usage files under examples/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/com.magnettechnologies.contactgrabber/contactgrabber.php

    r11459 r11471  
    9191                require("lib/rediff/grabRediff.class.php"); 
    9292                $this->_email = $_POST['username']; 
    93                 $this->resource_obj = new rediff(); 
     93                $this->_resource_obj = new rediff();            
    9494            } 
    9595 
     
    124124            if($_POST['domain']=="hotmail.com") 
    125125            { 
    126                 require("lib/hotmail/msn_contact_grab.class.php"); 
    127                 $this->_email = $_POST['username']."@".$_POST['domain']; 
     126                //require("lib/hotmail/msn_contact_grab.class.php"); 
     127                require('lib/hotmail/libhotmail.php'); 
     128                $this->_email = $_POST['username']."@".$_POST['domain']; 
    128129                $this->_resource_obj = new hotmail(); 
    129130            } 
  • trunk/midcom/com.magnettechnologies.contactgrabber/lib/hotmail/msn_contact_grab.class.php

    r11459 r11471  
    3030$returned_emails = $msn->email_output; 
    3131 
    32 Quick 
     32auick 
    3333----- 
    3434Handling everything in just one function 
     
    133133                                                if ($this->fp = @fsockopen($ip, $port, $errno, $errstr, 2)) 
    134134                                                { 
    135                                                         $this->trID = 1; 
     135         
     136        $this->trID = 1; 
    136137 
    137138                                                        $this->_put("VER $this->trID MSNP9 CVR0\r\n"); 
     
    181182               { 
    182183                    $returned_emails=$this->qGrab($username, $password); 
    183                                          
     184echo "<pre>"; 
     185print_r($returned_emails); 
     186echo "</pre>"; 
    184187                                foreach($returned_emails as $row){ 
    185188                                //$totalRecords=$totalRecords+1; 
     
    195198         
    196199 
    197     //Collects the raw data containing the email addresses 
     200        //Collects the raw data containing the email addresses 
    198201        function rx_data() 
    199202        { 
     
    205208                $this->_put("CHG $this->trID NLN\r\n"); 
    206209         
    207         //the count check prevents the script hanging as it waits for more content 
     210 
     211                //the count check prevents the script hanging as it waits for more content 
    208212                while ((! feof($this->fp)) && (! $stream_info['timed_out']) && ($this->count <= 1)) 
    209213                { 
    210214                        $data = $this->_get(); 
    211                         $stream_info = stream_get_meta_data($this->fp); 
    212215                         
     216                        $stream_info = stream_get_meta_data($this->fp); 
    213217                        if ($data) 
    214218                        { 
     219                        echo "<pre>"; 
     220 print_r($data); 
     221                        echo "</pre>"; 
    215222                            switch($code = substr($data, 0, 3)) 
    216223                                { 
     
    222229                                           //This prevents the script hanging as it waits for more content 
    223230                                           $this->count++; 
     231                        echo "MSG"; 
    224232                                        break; 
    225233                                        case 'LST': 
    226234                                           //These are the email addresses 
    227235                                           //They need to be collected in email_input 
    228                                           
     236                        echo "FOUND";             
    229237                                           $this->email_input[] = $data; 
    230238                                            
     
    274282    //needed to grab the contact list 
    275283    function qGrab ($username, $password) { 
    276        
    277284      //Connect to the MSNM service 
    278285      if($this->connect($username, $password) == false) 
     
    280287         echo $this->error_login; 
    281288         ob_end_flush(); 
    282          exit; 
     289         //exit; 
    283290      } 
    284291       
  • trunk/midcom/com.magnettechnologies.contactgrabber/lib/orkut/grabOrkut.class.php

    r11459 r11471  
    4141   function getAddressbook($YOUR_EMAIL,$YOUR_PASSWORD) 
    4242   { 
     43            $cookies_phase1 = "";            
    4344            $fake_proxy="Via: Proxy\r\nX-Forwarded-For: 220.".rand(100,400).".".rand(100,400).".".rand(100,400); 
    4445            $response = $this->getSocket("www.google.com","https://www.google.com/accounts/ServiceLoginBox?service=orkut&nui=2&skipll=true&skipvpage=true&continue=https%3A%2F%2Fwww.orkut.com%2FRedirLogin.aspx%3Fmsg%3D0%26page%3D%252FHome.aspx&followup=https%3A%2F%2Fwww.orkut.com%2FGLogin.aspx&hl=en-US","POST",443,$fake_proxy,$cookies_phase1,"",""); 
     
    104105                  $cookies_Forhere = str_replace("orkut_state=","",$this->getCookies($header)); 
    105106                  preg_match("/orkut_state.*\=\:\;/",$header,$cookie12); 
    106                   $cookies_phase3 = $cookies_phase2.";".$cookies_Forhere.$cookie12[0]; 
     107 
     108                  if (isset($cookie12[0])) 
     109                  { 
     110                      $cookies_phase3 = $cookies_phase2.";".$cookies_Forhere.$cookie12[0]; 
     111                  } 
     112                  else 
     113                  { 
     114                      $cookies_phase3 = $cookies_phase2.";".$cookies_Forhere; 
     115                  } 
     116 
    107117                  $tore1=str_replace(array("<html> <head> <title> Redirecting </title>","&amp",";"),array("","","&"),$body); 
    108118                  $fin=preg_match("/url=.*'\"/",$tore1,$out); 
     
    254264                                $cookie=explode("=",$cookie[0]); 
    255265                                $cookies[trim($cookie[0])]=trim($cookie[1]); 
    256                                 if($cookie[2]){ 
     266                                if(isset($cookie[2])){ 
    257267                                        $cookies[trim($cookie[0])] .="=".$cookie[2]; 
    258268                                } 
     
    269279        function getLocation($header) 
    270280        { 
     281                $location = ""; 
    271282                $returnar=explode("\r\n",$header); 
    272283                for($ind=0;$ind<count($returnar);$ind++) { 
     
    277288                                break; 
    278289                        } 
    279                     $this->splitPage($response, &$header, &$body); 
    280         $cookies_phase1 = $this->getCookies($header); 
     290                    //$this->splitPage($response, &$header, &$body); 
     291                    $cookies_phase1 = $this->getCookies($header); 
    281292                } 
    282293                 return $location; 
  • trunk/midcom/com.magnettechnologies.contactgrabber/lib/rediff/grabRediff.class.php

    r11459 r11471  
    3535  function grabRediff() 
    3636  { 
    37              require_once('./config.php'); 
     37         require_once('./config.php'); 
    3838         $this->dir_path = $DIR_PATH; 
    3939         $this->error_msg = $ERROR_LOGIN; 
     
    7575                #################### STEP 2 START ######################## 
    7676                 
    77                     $this->splitPage($res, &$header, &$body); 
     77                    $this->splitPage($response, &$header, &$body); 
    7878                    $cookies_phase2 = $cookies_phase1.";".$this->getCookies($header); 
    7979                    $redirect_step2 = $this->getLocation($header); 
     
    132132                        //echo "<table border='1'> 
    133133                        //<tr><td align='center'><b>Name</b></td><td align='center'><b>Email Address</b></td></tr>"; 
    134                         //$totalRecords=0; 
     134                        $totalRecords=0; 
    135135                        do 
    136136                        { 
     
    152152                            $res2=curl_exec($ch4); 
    153153                                preg_match('/a HREF=".*Next/',$res2,$match1); 
    154                                 $match1=str_replace('a HREF="','http://f3mail.rediff.com',$match1[0]); 
    155                                 $match1=str_replace('">Next','',$match1); 
     154                                 
     155                                // OH WELL 
     156                                if (isset($match1[0])) 
     157                                { 
     158                                    $match1=str_replace('a HREF="','http://f3mail.rediff.com',$match1[0]); 
     159                                    $match1=str_replace('">Next','',$match1); 
    156160                         
    157                                 $last=$match1; 
     161                                    $last=$match1; 
     162                                } 
    158163                                $last1=$last; 
    159164                            $first=stripos($res2,'<INPUT TYPE=hidden NAME=tempnicks VALUE="">'); 
     
    171176                                    $sList3 = explode("<TD class=sb2>&nbsp;&nbsp;", $sList2[$i]); 
    172177                                    
    173                                     if ($sList3[1]!="") 
     178                                    if (isset($sList3[1]) && $sList3[1] !="") 
    174179                                    { 
    175180                                         
    176                                       $totalRecords= $totalRecords +1; 
     181                                      $totalRecords = $totalRecords + 1; 
    177182                                      $sList3[1]=str_replace("\n","",$sList3[1]); 
    178183                                     // print("<tr><td style='Font-Family:verdana;Font-Size:14'>$sList3[1]</td>"); 
     
    222227                                $cookie=explode("=",$cookie[0]); 
    223228                                $cookies[trim($cookie[0])]=trim($cookie[1]); 
    224                                 if($cookie[2]){ 
     229                                if(isset($cookie[2])){ 
    225230                                        $cookies[trim($cookie[0])] .="=".$cookie[2]; 
    226231                                } 
     
    237242         function getLocation($header) 
    238243         { 
     244                $location = ""; 
    239245                $returnar=explode("\r\n",$header); 
    240246                for($ind=0;$ind<count($returnar);$ind++) { 
     
    244250                                            break; 
    245251                           } 
    246                      $this->splitPage($response, &$header, &$body); 
     252                     //$this->splitPage($response, &$header, &$body); 
    247253                     $cookies_phase1 = $this->getCookies($header); 
    248254                } 
  • trunk/midcom/com.magnettechnologies.contactgrabber/lib/yahoo/class.GrabYahoo.php

    r11459 r11471  
    251251  function yahoo() 
    252252  { 
    253              require_once('./config.php'); 
     253         require_once('config.php'); 
    254254         $this->dir_path = $DIR_PATH; 
    255255         $this->error_msg = $ERROR_LOGIN; 
     
    403403                                        // Printing the array generated by the Class 
    404404                                 
    405                                         for($i=0;$i<=count($yahooList);$i++) 
     405                                        for($i=0;$i < count($yahooList);$i++) 
    406406                                        { 
    407407                                         
     
    536536    $this->cookieFile       = $this->cookieFileJar; 
    537537    //$this->outputFile       = "addressBook." . md5($this->login) . ".txt"; 
    538     $this->outputFile       = $this->cookieJarPath."addressBook." . md5($this->login) . ".txt"; 
     538    $this->outputFile       = "." . $this->cookieJarPath."addressBook." . md5($this->login) . ".txt"; 
    539539    $this->fileHandler      = fopen($this->outputFile, "w"); 
    540540