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.

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.

How Bloggers Get Some People Mad

Prominent liberal blogger Markos Moulitsas Zúniga, who runs one of the most popular liberal and progressive blogs in the world, says Google News is becoming unusable.

“They need some serious soul-searching about what they are and what their mission is.”

“A news operation needs to present news, and credible news at that. That means get rid of the blogs (mostly opinion), get rid of the no-name sites, the conspiracy sites, and the rest of that crap.”

Obviously, he wasn’t the first. I mean, how many times have you googled around lately to find informations about X events, or Y products or Z services and get personal web blogs on the top ten of the results?

I personally do not have any problem with that, since people don’t read average web blog, and Google algorithm has ensured that only those of really important websites will show up at the top results.

That means, if you really want to get informations about something that also includes what most people think as important too.

The How

The interesting question is how web blogs can do that. In my experience running this blog, i can see easily that web blogs possess many qualities that search engines like Google and Yahoo really loves to see. They are,

  • Frequent updates to content and pages
    Blog is used to enable people publishes anything easily on the web in chronological ways. The quality of a blog is sometime determined by how frequent the contents are updated.
  • Text dominated
    Since search engine indexing only works for text, blog entries which usually filled with more text than image become favorable.
  • Carefully orginized content structure
    This due to categorized topic and archival previous entries that come with almost every blog system. And some blog applications like wordpress has great plugins that can create sitemap and submit it automatically to Google. This surely helps search engine spider to crawl blog easily.
  • Important text wrapped in header elements

    It is well known that search engine try to understand a web page by its header elements (meta). Many blog application has this built in features.

  • Friendly URL
    Using htaccess and some functions to process query string.
  • Link Management

    Search engine like Google has page rank system which calculates the important of a web page by how it links to others and being linked by others. Many blog system has this feature to create link easily and trackback system to notice the owner when his entry being linked by other blog using the same trackback mechanism.

In addition, with many blogs aggregator, blogs search engine and feed syndicator out there makes a web blog easier to get promoted. Sometime even without the owner realizing it.

Pinging Google blog search for WordPress

In addition to my previous google pinging services, for you who use wordpress you can also add google blog search ping into your update services.

Once you’ve logged into WP, go to Options > Writing and add this line under “Update Services”:

http://blogsearch.google.com/ping/RPC2