Auto post to Blogger with PHP
Similar to the way that plugins like wp-o-matic work for automatically posting rss feeds to Wordpress blogs, you can have a blogger blog which is automatically populated with RSS feed content, at intervals that you determine (by a cron job).
Blogger blogs allow the blogs owner to post via email, so we’re going to use PHP’s mail function to post new content, and PHP’s SimpleXML to gather the content before posting.
Firstly, we need to set up our blogger blog to accept emailed posts: We need to go to our settings page in Blogger, and click the “Settings” tab at the top. Then click the “email” button.
You’re now at the Email settings page, look for the Mail-to-Blogger Address. Here you just need to enter a password (in the box before the “@ablogger.com”) that you’ll use in your emails to post to the blogger blog.
Once you’ve chosen your password, write down the email address, as this is the email address we’ll be using in the PHP script to tell it where to post the rss feed to.
Now on to the script:
<?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(”<b>”, “”, $title);
$subject = str_replace(”</b>”, “”, $title);
$link = $item->link;
$description = $item->description;
$description = str_replace(”<b>”, “”, $description);
$body = str_replace(”</b>”, “”, $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<br>”;
}
else
{
echo $subject. ” - NOT sent<br>”;
}
}
//add one to our counter
$i++;
}
?>
Random Post
1 Comment
Leave Your Comments Below
Related Articles
- How to create Shortlinks with Google Apps
- How to use Adsense again if get banned
- Mechanisms against Spam Mail
- How to protect login on Wordpress admin ?
- How to submit your website on Microsoft
- How to setup POP3 Yahoo for business ?
- How to setup POP3 yahoo mail ?
- How to surf website by VPN
- How to setup Google Apps mail services
Recent Posts
- Free Panda Internet Security 2010: Windows 7 Launch Party
- FREE 1-year license of Kaspersky Internet Security 2010!
- Warning hack password Yahoo mail !
- How to Use Western Union quick cash at Google Adsense ?
- Western Union available in VietNam
- Facebook for Nokia phones
- DailyMotion now offering Embed HD Video Players
- Free Adword voucher $50
- How to create Shortlinks with Google Apps
- Auto post to Blogger with PHP
- Free Auto Blogger: Auto post rss feed
- The Google Analytics API and PHP
- Using the Google Analytics API - getting total number of page views
- Google Analytics PHP API class
- Blogger team warning Spam posts
- Adsense launching “Category filter Beta”
- Alternatives to Google Adsense by other programs
- What is Adsense Smart Price ?
- How to avoid Adsense Smart Pricing ?
- How to use Adsense again if get banned
Recent Comments
- Nancy
in Auto post to Blogger with PHP - Tony M J
in DailyMotion now offering Embed HD V… - fonfenVak
in Enable Ping track in wordpress - DaiVyCorp - Int…
in My Google AdSense Account Is Disabl… - DaiVyCorp - Int…
in My Google AdSense Account Is Disabl… - AlexAxe
in VPN Protocols - jennefoh
in Make more money: YouTube Videos Com… - GlenStef
in VPN Protocols - DaiVyCorp - Int…
in Why should I use proxy servers ? - Alexwebmaster
in VPN Protocols
Most Commented
- Top 10 ways to boost alexa ranking (4)
- How to Boost Alexa Ranking (4)
- VPN Protocols (4)
- Make more money: YouTube Videos Coming to AdSense (2)
- My Google AdSense Account Is Disabled (2)
- Top 10 secrets success with business online (1)
- SEO with Site Address / URL (1)
- Free Ways to Increase Your Blog Traffic (1)
- How to SEO wordpress, The Complete Guide (1)
- Manual Unzip Server Command (1)
Most Viewed Post
- Adsense launching “Category filter Beta” - 1,075 views
- How to SEO Copywrite - 990 views
- Top 10 ways to boost alexa ranking - 801 views
- How to Prevent Spam VBB with GeoIPCountry - 702 views
- SEO with Site Address / URL - 655 views
- Invalid Clicks Contact Form: How to contact to Google Adsense support Team - 651 views
- Tutorial: IPSec Security structure - 649 views
- Auto post to Blogger with PHP - 649 views
- Youtube with google adsense - 600 views
- Warning hack password Yahoo mail ! - 584 views
Categories
- How to (51)
- SEO (33)
- Google adsense (31)
- Business land (13)
- Security Policies (21)
- Tips (26)
- Technology news (7)
- Traffic guide (9)
- Top secrets MMO (6)
- Tutorials (10)










How to custom the setting for other feed source like google news or article directory?
I tried google news but only the title ok, the description massed.
Any suggestions?
Thanks.