Cara Auto Blog Post Menggunakan Script PHP Versi 1

Agan2, ane mau kasih sedikit script biar blog kita auto post dengan syarat email auto post di blogspot nye udah diaktifin. Ane dapet artikel ini dari

http://bajoprogram.blogspot.com/2011/02/auto-post-to-blogger-with-php.html

Ini dia scriptnya :



    <?php

     //Your Blog's Keyword:

    $keyword = "keyword";

    //How many articles do you want to grab each time?

    $num = 5;

    //Get the RSS Feed - In this instance, we're using a google blogsearch feed based on our chosen keyword

    $feed = simplexml_load_file("http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&q=" .urlencode($keyword). "&ie=utf-8&num=10&output=rss");

    //Loop through our keywords

    foreach ($feed->channel->item as $item) {

    if($i < $num){

    //Have a bit of a rest so we're not posting too fast to our blogger blog

    sleep(10);

    $title = $item->title;

    $title = str_replace("", "", $title);

    $subject = str_replace("", "", $title);

    $link = $item->link;

    $description = $item->description;

    $description = str_replace("", "", $description);

    $body = str_replace("", "", $description);

    //put our secret blogger email address here:

    $to = "accountname.password@blogger.com";

    //ignore this line - the script just needs something in the "From" field.

    $headers = 'From: mail@whatever.com';

    //Send the email / How'd we go?

    if(mail($to, $subject, $body, $headers)) {

    echo $subject. " - sent

    ";

    }

    else

    {

    echo $subject. " - NOT sent

    ";

    }

    }

    //add one to our counter

    $i++;

    }

    ?>

 Upload script tersebut kedalam hostingan kamu. Jadi script ini hanya bekerja di saat kita memanggilnya.
Previous
Next Post »

1 comments:

Write comments