Advertisement
zaksya

Email Filter

Mar 30th, 2018
1,460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.82 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. /*
  4.     Email Filter Beta V.1
  5.     Code By ZakirDotID
  6.     CopyRight x20 Family Coder
  7. */
  8. trait Email {
  9.     public static function _sv($name,$data){
  10.         $fp = @fopen(date("d").$name, "a+");
  11.         fwrite($fp, $data);
  12.         fclose($fp);
  13.     }
  14.     public static function _r($email,$regex){
  15.         return preg_match("/([aA-zZ]*.)(\@".$regex.")\.([aA-zZ]+)/",$email);
  16.     }
  17.     public static function _f($email,$x){
  18.         switch ($x) {
  19.             case '1':
  20.                 return 'gmail';
  21.             break;
  22.             case '2':
  23.                 return 'hotmail';
  24.             break;
  25.             case '3':
  26.                 return 'yahoo';
  27.             break;
  28.             case '4':
  29.                 return 'other';
  30.             break; 
  31.             case '5':
  32.                 return 'aol';
  33.             break;
  34.             default:
  35.                 return 'other';
  36.             break;
  37.         }
  38.     }
  39.     public static function _s($email){
  40.         if (self::_r($email,'gmail')) {
  41.             return self::_f($email,1);
  42.         } elseif (self::_r($email,'hotmail')){
  43.             return self::_f($email,2);
  44.         } elseif (self::_r($email,'yahoo')){
  45.             return self::_f($email,3);
  46.         } elseif (self::_r($email,'aol')){
  47.             return self::_f($email,5);
  48.         } else {
  49.             return self::_f($email,4);
  50.         }
  51.     }
  52.     public static function run(){
  53.         echo self::_h();
  54.         echo "\n\t Input File : ";
  55.         $files = trim(fgets(STDIN));
  56.         $file = file_get_contents($files) or exit("\n Fata Error : FIles Not Exits!\n");
  57.         $emails = explode("\r\n", $file);
  58.         echo "\n \====================================/\n Total ( ".count($emails). " ) \n \====================================/\n";
  59.         foreach ($emails as $email) {
  60.             if(self::_s($email) == 'gmail'){
  61.                 echo " [+] $email ==> gmail [-]\n";
  62.                 self::_sv('gmail-data.log',$email."\r\n");
  63.                 $gm = $gm + 1;
  64.             } elseif(self::_s($email) == 'hotmail'){
  65.                 echo " [+] $email ==> hotmail [-]\n";
  66.                 self::_sv('hotmail-data.log',$email."\r\n");
  67.                 $hm = $hm + 1;
  68.             } elseif(self::_s($email) == 'yahoo'){
  69.                 echo " [+] $email ==> yahoo [-]\n";
  70.                 self::_sv('yahoo-data.log',$email."\r\n");
  71.                 $yh = $yh + 1;
  72.             } elseif(self::_s($email) == 'aol'){
  73.                 echo " [+] $email ==> aol [-]\n";
  74.                 self::_sv('aol-data.log',$email."\r\n");
  75.                 $al = $al + 1;
  76.             } else {
  77.                 echo " [+] $email ==> other [-]\n";
  78.                 self::_sv('other-data.log',$email."\r\n");
  79.                 $ot = $ot + 1;
  80.             }
  81.         }
  82.         echo "\n \====================================/\n";
  83.         $gm = (!empty($gm)) ? $gm : "0" ;
  84.         $hm = (!empty($hm)) ? $hm : "0" ;
  85.         $yh = (!empty($yh)) ? $yh : "0" ;
  86.         $al = (!empty($al)) ? $al : "0" ;
  87.         $ot = (!empty($ot)) ? $ot : "0" ;
  88.         echo " [+] Kalkulasi Data [-] \n [+] Gmail : ( $gm ) \n [+] Hotmail : ( $hm ) \n [+] Yahoo ( $yh ) \n [+] Aol : ( $al ) \n [+] Other : ( $ot )\n";
  89.         echo " [+] Thanks Using My Tools! Developed By x20 Family [-]\n";
  90.     }
  91.     public static function _h(){
  92.         $h[] = "\t Email Filter V.1";
  93.         $h[] = "\t Code By ZakirDotID";
  94.         $h[] = "\t Don`t Change CopyRight!";
  95.         $head = implode("\n", $h);
  96.         return $head;
  97.     }
  98. }
  99. Email::run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement