Merhaba beyler wordpress için film botu yapmayı deniyorum az çok ortaya birşey çıkarttım fazla bilgi sahibi olmadığım için net birşey yapamıyorum
geliştirmek isteyen olursa.
geliştirmek isteyen olursa.
Kod:
<?php
function ara($bas, $son, $yazi)
{
[USER=293058]pre[/USER]g_match_all('/' . preg_quote($bas, '/') .
'(.*?)'. preg_quote($son, '/').'/i', $yazi, $m);
return @$m[1];
}
$icerik = file_get_contents("https://embedy.cc/video/yenilmezler");
$baslik = ara('<span class="title">', "</span></div>", $icerik);
echo $baslik[0];
echo '<br/>';
echo '<br/>';
echo '<br/>';
$resim = ara('<img width="320" height="240" src="', '"', $icerik);
echo '<img height="250px" src="'.$resim[0].'" /';
echo '<br/>';
echo '<br/>';
echo '<br/>';
$video = ara('href="/movies/' , '">', $icerik);
echo $video[0];
$my_post = array();
$my_post['post_title'] = '$baslik';
$my_post['post_content'] = '<img height="250px" src="'.$resim[0].'" /> $video[0]';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
$my_post['post_category'] = array(8,39);
// Yazıyı veritabanına ekle
wp_insert_post( $my_post );
?>