PJBlog已死
Trackback廣告的泛濫已經讓幾乎所有Blogger痛苦不已了,各種廣告羣發器令人無比煩惱
簡單瞭解了一下Trackback原理以後,寫了個PHP程序,原來羣發如此簡單。。。。。
給個鏈接 Trackback發送
<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>" lang="UTF-8">
<meta http-equiv="Content-Language" content="UTF-8" />
<?php
function sendTrackback($host,$title,$url,$excerpt,$blog_name)
{
$buf="";
$host = str_replace('<a href="http://" target="_blank">http://</a>', '', $host);
$path = explode('/', $host);
$host = $path[0];
unset($path[0]);
$path = '/' . implode('/', $path);
$fp = @fsockopen($host, 80, $errno, $errstr, 30);
if(!$fp)
return false;
$blog_name=str_replace("'", "''", $blog_name);;
$query = 'title=' . rawurlencode($title);
$query .= '&excerpt=' . rawurlencode($excerpt);
$query .= '&url=' . rawurlencode($url);
$query .= '&blog_name=' . rawurlencode($blog_name);
$out = 'POST ' . $path . ' HTTP/1.1' . "\r\n";
$out .= 'Host: ' . $host . "\r\n";
$out .= 'Connection: close' . "\r\n";
$out .= 'Content-Length: ' . strlen($query) . "\r\n";
$out .= 'Content-Type: application/x-www-form-urlencoded; charset=iso-8859-1' . "\r\n\r\n";
$out .= $query . "\r\n";
fwrite($fp, $out);
while (!feof($fp))
$buf .= fgets($fp,128);
fclose($fp);
$arr=explode("<error>",$buf);
if($arr[1]==0)
return "發送成功";
else
return "發送失敗".$arr[1];
}
$k=$_POST[repeat];
for ($i=1;$i<=$k;$i++)
{
echo $i.sendTrackback($_POST[trackurl],$_POST[title].$i,$_POST[url]
.$i,$_POST[detail].$i,$_POST[myblog].$i)." ";
flush();
}
?>
<form name="form" action="" method="post">
引用通告地址<input name="trackurl" type="text">
標題<input name="title" type="text">
鏈接<input name="url" type="text">
內容<input name="detail" type="text">
我的博客標題<input name="myblog" type="text">
發送次數<input name="repeat" type="text" value="1">
<input type="submit" name="Submit" value="發送">
</form>