Created
December 8, 2011 02:35
-
-
Save hzlzh/1445863 to your computer and use it in GitHub Desktop.
Catch sites' meta description with SSH
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 | |
$filename='src.txt'; | |
$str=file_get_contents($filename); | |
$arr=explode("\n",$str); | |
$file = fopen("result.txt","w"); | |
$count = 1; | |
foreach($arr as $row){ | |
$html = @file_get_contents($row); | |
list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3); | |
$value = @get_meta_tags($row); | |
if($value['description']) | |
fwrite($file,$count.'%$'.$row.'%$'.$status_code.'%$'.$value['description']."\r\n"); | |
else fwrite($file,$count.'%$'.$row.'%$'.$status_code.'%$'."###"."\r\n"); | |
$count++; | |
} | |
fclose($file); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment