-
+ 219A4FC0CDFE92C1972A536E37C4D3D9DCA6758D744EB7391787D87434543F1BB2961305A0F4DAB21EE42BDE64BC0870B70981EECAD38A29F308123BB42B76B5mp-wp/pingback-updater.php(0 . 0)(1 . 48)
139 <?^M
140 // Db connect data.^M
141 ^M
142 $db_name = '';^M
143 $db_user = '';^M
144 $db_pass = '';^M
145 ^M
146 $table_prefix = '';^M
147 ^M
148 $nconnection = mysql_connect("localhost", $db_user, $db_pass );^M
149 mysql_select_db($db_name, $nconnection);^M
150 ^M
151 // Index of post at which script last ran. Script won't look through earlier posts. You have to update the value manually. ^M
152 $last_run = 61145; ^M
153 ^M
154 // Part one : select all the posts that contain a link to your own blog. Replace the url adequately.^M
155 $local = "http://trilema.com/";^M
156 ^M
157 $query = 'SELECT YEAR(post_date), post_name, post_content FROM '.$table_prefix.'posts WHERE post_type ="post" AND post_content LIKE "%<a href=%" AND ID > '.$last_run;^M
158 $record = mysql_query($query);^M
159 ^M
160 while ( $row = mysql_fetch_array($record, MYSQL_NUM)) {^M
161 $post_url = "http://trilema.com/".$row[0]."/".$row[1];^M
162 // echo "<h1>",$post_url,"</h1>";^M
163 ^M
164 $dom = new DOMDocument();^M
165 @$dom->loadHTML($row[2]);^M
166 ^M
167 $xpath = new DOMXPath($dom);^M
168 $hrefs = $xpath->evaluate("/html/body//a");^M
169 ^M
170 for ($i = 0; $i < $hrefs->length; $i++) {^M
171 $href = $hrefs->item($i);^M
172 $url = $href->getAttribute('href');^M
173 ^M
174 $parse = parse_url($url);^M
175 echo 'curl -A "Mozilla/5.0" -r 0-4096 --connect-timeout 30 --max-time 10 "http://';^M
176 echo $parse['host'];^M
177 echo '/xmlrpc.php" --header "Content-Type: text/xml" --data "<?xmlversion="1.0"?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>';^M
178 echo $post_url;^M
179 echo '</string></value></param><param><value><string>';^M
180 echo $url;^M
181 echo '</string></value></param></params></methodCall>"'."\n";^M
182 }^M
183 ^M
184 }^M
185 ^M
186 ?>^M