It's Always About Sharing Information

One of the reasons I talked less and less about Apple over time was NOT because Apple told me to shut up. They never did, not once. But people kept taking stuff I said, and twisting it to attack Apple, or to try to spin it as if what I was saying was therefore Apple’s position.

Chuqui 3.0 : Blogging and Communication (and my final comments about Scoble. I hope)

That was the response from Chuqui, who is an ex Apple employee, regarding Scoble post. Chuq has made some good points that resonate with me why i wrote this blog,

Here’s the fun part: while Scoble talks about blogging as if there is no way to communicate without it being on a blog, he completely misses the bigger picture.

IT AIN’T ABOUT BLOGGING. It’s about communication. it’s about sharing information. It’s about solving problems.

When i was assigned to rebuild our company website, i suggested the manager to add blogs for employees in it. He simply rejected it. That’s when i decided to make this blog.

I was dissapointed for awhile until i realized that he had good reasons to do that. Not only it was a bad idea to ask employees to fill his/her blogs while tons of works must be done tomorrow. There are some other efficient ways to communicate to customer rather than pushing employees to write it down on a blog.

Furthermore, I feel much more comfortable to write anything i find interesting rather than writing something that might be interesting for company. Almost 100% of this blog has no related to any of what we’re doing, but often as not it brings some new good things for company without i even realized it.

My point is, it’s always about sharing information, and the best way of doing that is to do that for love, not for money. Although for some people like chuq, things were getting hard since people knew him too well as an Apple guy.

Ngeblog Host and Mailing List

Working on Ngeblog for the past two weeks has been a great time for me. Credits, suggestions and bugs report from many people are the main reason why i keep working on this class.

That’s why i’m asking you to promote this class, so that many people will be able to use it, take advantage of it, and hopefully that will bring more improvement to this class.

Beside on phpclasses, i have submitted Ngeblog to Google Code Project Hosting here :

http://code.google.com/p/ngeblog/

You can also find Ngeblog on Hotscripts here:

http://www.hotscripts.com/Detailed/64472.html

unfortunately it is hard for me to keep updating Ngeblog on hotscripts, since it takes awhile for any updates to be approved.

I’m also inviting you to join developing this class together by subscribing to Ngeblog-devel mailing list here:

http://groups.google.com/group/ngeblog-devel

Ngeblog 0.1 (Now support ClientLogin Authentication for both versions of Blogger)

Good news for Blogger Beta users, now Ngeblog can be used to manipulate your blog entry. 🙂

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 :

ClientLogin Authentication

As clearly stated in Blogger Data API documentation, now ClientLogin authentication can be used for both versions of Blogger. That surely makes our lives easier.

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);

Tester

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.

Firefox 2.0 Released Today

As you might have heard this like thousand times before, Firefox 2.0 is going to be released today. I’m not sure when “today” really is, since i live in different time zone from U.S.

But one thing for sure, i and maybe other thousand peoples out there has got it already. I downloaded it yesterday from one of its mirror. And after using it the whole days, i can only say this: go out and download it.

There are number of interesting features, especially for us as developer which are explained in detail here. Even Ilia has write it down some codes for us, using OpenSearch support that come with Firefox 2.0.

I think i’m going to have some fun with it for the next couple hours. I hope i can share it with you. Another class perhaps …

🙂

Ngoprek.web.id

I don’t know what is wrong with ngoprek.web.id domain, it seems rejected by Google and Technorati. I can’t ping www.ngoprekweb.com using technorati, i can’t submit it using Google adsense, even my email @ngoprek.web.id has been rejected by Google groups.

Since i’m not comfortable living isolated from the rest of the world, i moved my blog here: ngoprekweb.ngikutin.com. But you still can access my blog at www.ngoprekweb.com as usual, only now it is automagically redirected here.

I’m hoping somebody will solve this problem, but i haven’t received any confirmation from Technorati and Google this far, so from now on my blog can be accessed here.

Ngeblog 0.0.3

Another version? gee, this is fast. Well, what can i say, i got quick response too to my previous release. So, i’ll be doomed if i don’t change it sooner.

Thanks to Bill for his sugestion and code tester. So here you go.

Multiple Blogs

The problem with previous version of Ngeblog is you can’t choose which blogs will you manipulate, since i forgot about the fact that Blogger allows you to have multiple blogs in an account.

So i added a new method getBlogInfo() which will retrieve the information about your blogs in two dimensional array. All you have to do is write this simple codes,

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $bloginfo = $myblog->getBlogInfo();

  echo "<pre>";
  print_r($bloginfo);
  echo "</pre>";

?>

The output would be something like this:

Array
(
    [0] => Array
        (
            [blogid] => 36455441
            [title] => My first blog
            [url] => http://myfirstblog.blogspot.com
        )

    [1] => Array
        (
            [blogid] => 35946977
            [title] => My second blog
            [url] => http://mysecondblog.blogspot.com
        )

    [2] => Array
        (
            [blogid] => 36320167
            [title] => My third blog
            [url] => http://mythirdblog.mysite.com
        )

)

With this informations you can choose which blogs you’d like to add new post, edit post or delete post. To retain compatibility with previous version, you still can use the old methods (if you only have one blog in your Blogger account), only now you can add Blog ID input to choose which blog you’d like to manipulate.

For example, if you want to add new post to my first blog above,

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $title    = 'Ketupat Party';
  $msg      = '<u>Wow</u>, we\'re eating ketupat <i>now</i>?';
  $blogid   = '36455441';

  if ( $myblog->newPost($title,$msg,$blogid) ) {
    echo "Posting success";
  } else {
    echo "Posting failed";
  }

?>

To edit a post with entry id 116155171898341151 in my second blog above,

  $title    = 'New Ketupat Party';
  $msg      = '<u>Wow</u>, we\'re eating ketupat and chicken<i>now</i>?';
  $blogid   = '35946977';
  $entryid  = '116155171898341151';

  if ( $myblog->editPost($entryid,$title,$msg,$blogid) ) {
    echo "Update success";
  } else {
    echo "Update failed";
  }

To get the five of first entries in my third blog, do like this,


  $startindex = 1;
  $maxresults = 5;
  $blogid     = '36320167';
  $myblog->getPosts($startindex,$maxresults,$blogid);

Update yourself

Since i plan to make other improvements to this class, please always update yourself by following this category link in my blog. Or check the newest class here in phpclasses.

Ngeblog 0.0.2

What is Ngeblog? A nice guy from phpclasses has made great description for me,

This class can be used to manipulate Blogger blogs using the GData, the Google Data API.

You can download the newest files here. I included some example files there.

There are some dramatic changes i made for this version, including methodes naming and code beautification. Hopefully, with this new codes, it will be easy to extends it in the future.

So, if you happened to use the older version, you should make some changes too. Here are the newest howto’s,

Get an entry

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $entryid = 116086097264268587;  // entry ID you want to get
  $res = $my blog->getPost($entryid);

  echo "<pre>";
  print_r($res);
  echo "</pre>";

?>

Get list of entries

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $res = $myblog->getPosts(1,5);  // this will get five entries from first index

  echo "<pre>";
  print_r($res);
  echo "</pre>";

?>

Post a new entry

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $title  = "This is my title";
  $msg    = "<p>This is your <i>content</i></p>";

  if ( $myblog->newPost($title,$msg) ) {
    echo "posting success";
  } else {
    echo "posting failed";
  }

?>

Delete an entry

<?php

  require_once 'Ngeblog.php';

  $myblog = new Ngeblog("yourusername","yourpassword");

  $entryid = '116086019043835900'; // the entry id to be deleted

  if ( $myblog->deletePost($entryid) ) {
    echo "The entry with id $entryid has been deleted";
  }

?>

Update an entry

<?php

  require_once "Ngeblog.php";

  $myblog = new Ngeblog("yourusername","yourpassword");

  $entryid  = "116148936968661097"; // entry ID you want to update
  $newtitle    = "My New Title";
  $newmsg      = "<p>This is your <i>content</i></p>";

  if ( $myblog->editPost($entryid,$newtitle,$newmsg) ) {
    echo "Updating entry $entryid success";
  } else {
    echo "Updating failed";
  }

?>

Ngeblog in PHPClasses

elephpant logo

Yesterday, i receive this email from PHPClasses,

This message is to let you know that your package “Ngeblog” was considered notable. Congratulations! *****

This means that the site users interested in packages that have something special, are being notified to pay special attention to your package.

Notable packages are carefully hand picked by a site moderator. The moderator that picked your package wrote the following comment:

“Useful class for authors with blogs in Blogger. It uses Google Data API to manipulate posts in a Blogger blog.”

Hopefully this will encourage you to continue to submit more notable packages to the site.

Once again, congratulations!

The PHP Classes site

Well, that surely encourage me to make some improvement, so i’ve just uploaded the newest version, Ngeblog 0.0.2. Check it out here.