Skip to content

Instantly share code, notes, and snippets.

@tabuna
Created July 20, 2017 13:43
Show Gist options
  • Save tabuna/b544f744ec7dccfda981d0a9fbf6299b to your computer and use it in GitHub Desktop.
Save tabuna/b544f744ec7dccfda981d0a9fbf6299b to your computer and use it in GitHub Desktop.
Top 1M
<?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