If you’re using previous version of Ngeblog, don’t worry, you still can use all the methods as before, only now you can do more. Especially if you’re using Blogger in beta version.
As usual, i’m going to blab on a bit about this newest version, so if you can’t wait any longer to play around with it (i know some of you are like that) just go here and try it out yourself.
Ok, here are some additional features in Ngeblog 0.1 :
Unfortunately, previous version of Ngeblog still used BasicAuth for its authentication method, which is only valid for current version of Blogger, not for Blogger currently in beta . That’s why you need to download Ngeblog ver. 0.1 to be able to access Blogger in Beta version.
In implementation case, there’s nothing new in Ngeblog. You put some parameters (username and password) in constructor to connect to Blogger, like this:
<?php $username = "yourusername"; $password = "yourpassword"; $myblog = new Ngeblog($username,$password); $bloginfo = $myblog->getBlogInfo(); print_r($bloginfo); ?>
Only now, Ngeblog will try to detect whether you’re trying to connect to current version of Blogger or beta version. And all authentication is done using Google ClientLogin method.
Multiple Blogs Shorthand
As i mentioned in previous post, Blogger allows you to have more than one blog per account, and each blog has its own Blog ID. Ngeblog supports multiple blogs access by defining which blog ID are you trying to access.
Thanks to Bill, now you don’t have to carry Blog ID in all methods like before, you just need to define it once in constructor, like this:
$username = "yourusername"; $password = "yourpassword"; $blogid = "81928938"; $myblog = new Ngeblog($username,$password,$blogid);
then the rest of methods will assume you’re manipulating blog ID 81928938 without having to define it in all methods. For example to add new post, you just have to write something like this,
$title = "My Title"; $content = "My content for this blog"; $myblog->newPost($title,$content);
If you need to switch to another blog in the middle of your scripts, use setActiveBlog() method, like this:
$anotherblogid = "84748478"; $anothertitle = "My Title for another blog"; $anothercontent = "My content for another blog"; $myblog->setActiveBlog($anotherblogid); $myblog->newPost($anothertitle,$anothercontent);
Enough talks, if you still can’t understand what i’m talking about here, check out the tester here, i build it with Ngeblog 0.1. Just enter your username and password whether for current version or beta version of Blogger.