Witam Nie wiem czy juz byl o tym wątek ale dodanie pingowania do skryptu mocnelinki to byloby bardzo dobre rozwiązanie, pingowanie po każdym dodaniu wpisu, można by też dodać akcję do crona, dynamiczny sitemap dla gogla to też niezły pomysł. Przepraszam jeżeli były o tym wątki
<item> <title>Blog o Hotelach</title> <link>http://presell.waw.pl</link> <description>Zapraszam na Precla o Hotelach</description> <guid isPermaLink="true">http://presell.waw.pl</guid>
Teraz tworzymy plik ping.php o zawartości i modyfikujemy
<?php // Tu wtypełniamy w kolejności: tytuł, adres url z http,listapingów
$blogTitle="Tytuł"; $blogUrl="http://"; $pingListFile="pinglist.txt"; $showDebugInfo=FALSE; // Do you want verbose output?
// Skończ edycję
$replacementCount=0; $userAgent="pingrpc.php by tayefeh";
// Read pinglist file. Must contain one fully qualified URL // (e.g: http://rpc.technorati.com/rpc/ping) PER LINE (-> // delimiter is an ASCII-linebreak) $fp=fopen($pingListFile,"r"); while ( ! feof( $fp) ) { $line = trim(fgets( $fp, 4096)); // get the hostname $host=$line; // Make a copy of $line $host=preg_replace('/^.*http:\/\//','',$host); // Delete anything before http:// $host=preg_replace('/\/.*$/','',$host); // Delete anything after behind the hostname
// get the path $path=$line; // Make another copy of $line //$path=preg_replace('/^.*http:\/\/[a-zA-Z0-9\-_\.]*\.[a-zA-Z]{1,3}\//','',$path,-1,$replacementCount); // Delete anything before the path if(!$replacementCount) $path=''; // if there was no replacement (i.e. no explicit path), act appropiately if($host) $myList[$host]=$path; } echo "<h1>Ping process started</h1>";
// Use DOM to create the XML-File $xml= new DOMDocument('1.0'); $xml->formatOutput=true; $xml->preserveWhiteSpace=false; $xml->substituteEntities=false;
// Create the xml structure $methodCall=$xml->appendChild($xml->createElement('methodCall')); $methodName=$methodCall->appendChild($xml->createElement('methodName')); $params=$methodCall->appendChild($xml->createElement('params')); $param[1]=$params->appendChild($xml->createElement('param')); $value[1]=$param[1]->appendChild($xml->createElement('value')); $param[2]=$params->appendChild($xml->createElement('param')); $value[2]=$param[2]->appendChild($xml->createElement('value'));
// Set the node values $methodName->nodeValue="weblogUpdates.ping"; $value[1]->nodeValue=$blogTitle; $value[2]->nodeValue=$blogUrl;
$xmlrpcReq = $xml->saveXML(); // Write the document into a string $xmlrpcLength = strlen( $xmlrpcReq ); // Get the string length.
echo "Here's the xml-message I generated (size: $xmlrpcLength bytes):";