Skip to content

Instantly share code, notes, and snippets.

@hzlzh
Created December 8, 2011 02:35
Show Gist options
  • Save hzlzh/1445863 to your computer and use it in GitHub Desktop.
Save hzlzh/1445863 to your computer and use it in GitHub Desktop.
Catch sites' meta description with SSH
<?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