Created
July 20, 2017 13:43
-
-
Save tabuna/b544f744ec7dccfda981d0a9fbf6299b to your computer and use it in GitHub Desktop.
Top 1M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
$top = fopen('./top-1m.csv','r'); | |
$client = new GuzzleHttp\Client(); | |
while ( ($data = fgetcsv($top) ) !== FALSE ) { | |
$sitename = $data[1]; // google.com | |
try { | |
$response = $client->get('http://' . $sitename . '/.git/',[ | |
'connect_timeout' => 3, | |
'verify' => false, | |
]); | |
$content = $response->getBody()->getContents(); | |
if(stristr($content, 'branches') === FALSE) { | |
continue; | |
} | |
$file = 'white.txt'; | |
$sitename = $sitename."\n"; | |
file_put_contents($file, $sitename, FILE_APPEND | LOCK_EX); | |
}catch (Exception $exception){ | |
continue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment