her hangi bir sitenin feedini alabilirsiniz
uğraşmak geliştirmek isteyen olabilir
bu bot betik halindedir plugin değildir
sorumluluk kullanan kişiye aittir
<?php
header ("Content-Type: text/html; charset=utf-8");
include('wp-load.php');
//içeriğini almak istediğiniz sitenin feed urlsini buraya girin
$xml = simplexml_load_file('https://wordpress.org/news/feed/');
$s=0;
foreach($xml->channel->item as $item){
if($s<50){
$baslik = $item->title;
echo '<h1>'.$item->title.'</h1>
<hr>'.$item->description.' ref = '.$item->link.' <hr>';
global $wpdb;
$wpdb->get_results("SELECT * FROM wp_posts where post_title='$baslik' and post_type='post'");
$adet = $wpdb->num_rows;
if ($adet > 0) {
echo "$baslik Önceden eklenmiş";
}
else{
$my_post = array();
$my_post['post_title'] = "$item->title";
$my_post['post_content'] = "$item->description <br> $item->link.";
$my_post['post_status'] = "publish";
//$my_post['post_category'] = >array(3);
//$my_post['post_author'] = "1";
$post_id= wp_insert_post( $my_post );
}
}
$s++;
}
?>kullanımı xmlbot.php olarak kaydedip wp ana dizine atın
tarayıcıdan x.com/xmlbot.php çağırıdığında içeriği almış olacaktır.