Use of Titanium Facebook Graph API with helps of Facebook Graph Explorer

Facebook Graph Explorer provides useful tool helps developers to test it out the Graph API easily by issuing a REST-liked Request URL, HTTP Method (GET, POST, DELETE) to query or posting to the Facebook Objects.

Titanium mobile is a development platform to develop native mobile apps using JavaScript API.

Titanium mobile has delivered built-in Facebook APIs that greatly helps developers to integrate their mobile apps with Facebook. The Titanium Facebook API supports issuing an old REST API or a new Graph API to interact with Facebook Platform.

I tested out Facebook Graph Explorer and found that it is very helpful that guided me in a straight way to issue Titanium Facebook Graph API to query the Facebook Pages feeds, posting feeds and the posting feeds comments on behalf of user.

I had written a snippet of code in order to prove that it is worked.

Titanium Mobile JS Code:


var win = Ti.UI.currentWindow;
Titanium.Facebook.appid = "70518428114";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
Titanium.Facebook.requestWithGraphPath('70518428114/feed', {message : 'I love you my angels'}, 'POST', function(e) {
var result = e.result;
result = JSON.parse(result);
var newid = result.id;
Ti.Facebook.requestWithGraphPath(newid + '/comments', {message : 'I love you too darling'}, 'POST', function(ce) {
alert("Had made a Facebook comment");
});
});

The Titanium code above is trying to publish a feed on a page using Titanium Facebook Graph API, and then the result of new feed ID is returned which used for the next Graph API request to create a comment for that feed.

In the function Titanium.Facebook.requestWithGraphPath, we provide first parameter as the graph URL request, followed by the data to be passed by, and then to specify the HTTP method parameter (GET, POST, DELETE), and then followed by the callback parameter which JSON result will be returned. You can use these three HTTP method parameter to issue request to same graph URL request to perform different thing, such as to use GET to query out the list of data, to use POST to insert or update data, and to use DELETE to delete the data. It is REST-ful.

iPhone Simulator Print Screen showing the alert message:

iPhone Simulator showing alert box after Facebook Comment created

Facebook Print Screen showing the Facebook feeds and comments had been posted by Titanium Facebook Graph API.

(Click the thumbnails to see full image preview)

Conclusion

Facebook Graph Explorer greatly helps developers to test it out the Facebook Graph API and Titanium mobile had delivered its simple-to-use Facebook API module that made integration of our mobile apps to Facebook Platform become very easy.

Google+ Hangouts API Developer Preview Release

Google+ is a new social networking site and Google+ Hangouts is a feature supports real time video communication among up to 10 participants run inside browser.

Google+ just released its Google+ Hangouts API Developer Preview at 14 December 2011 which introduced JavaScript interface that enables our apps to interact with the Hangouts stuff, such as list out the participants, controlling some aspects of user interface, sharing data between our created apps. Currently Hangouts API is in developer preview release to collect the feedbacks from developers and it is subjected to change.

Link to Google+ Hangouts API: https://developers.google.com/+/hangouts/reference

Bson – Binary JSON

BSON, short for Bin­ary JSON, is a bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments. Like JSON, BSON sup­ports the em­bed­ding of doc­u­ments and ar­rays with­in oth­er doc­u­ments and ar­rays.

BSON is used by MongoDB to represent its document-oriented database structure.

Related Links:

1) BSONhttp://bsonspec.org
2) MongoDBhttp://mongodb.org

Node.JS playground 20111211

This weekend I played around with Node.JS, all around JavaScript. Here some notes.

I sign up for Tropo and set up some sample code to play with the telephony related stuff. It is free to test when in developing mode until your apps run into production mode then need to pay.

I simply played say.js, it is a text-to-speech engine in Node.JS, supports Mac OS X and Linux. It used Mac built-in text to speech engine while in Linux it requires Festival to be installed.

Another great library brain.js, it is able to build neural networks on Node.JS and client browser, purely written in JavaScript. Neural network is an Artificial Intelligence technique that mostly used in forecasting and prediction field.

Another library cron.js, it is able to schedule recurring jobs in Node.JS. It used Unix’s Cron liked expression to trigger the job.

Both of them just provide easier to use API that easily integrated into any enterprise application.

Node.JS is a relatively new programming language but its community grows extremely fast. There are many exciting libraries built into Node.JS. It may still not yet suitable for enterprise application but some of the organizations had tried to use it in production, for example, Linked In used Node.JS to build its entire mobile site platform.

Setia Miracle Melodies Night

Attending Setia Miracle Melodies night near my home with my sister. This event hold for open ceremonies for SP Setia Cascadia. Lets buy Setia home here, nice place for Work, Learn, Play.

Started with wonderful magic shows presented by several USA popular magicians.

Next with Zainal Abidin, then 梁静茹,主持人是郭亮。

So crowd people there. Play games and lucky draws for 5 iPad 2.

We back by walk and run to our home!

听了最后一首<勇气>,我想说,My Angels, Amour Than Always.

我只拍了一些烟花,今天也有月蚀。

20111210-224427.jpg

20111210-224435.jpg

20111210-224443.jpg

DiscuzX 2.5 新功能亮点

《站长》第35期 介绍了下一个 Discuz 版本, DiscuzX 2.5,之新功能亮点。

http://zz.comsenz.com/mt35/

我最喜欢的就是自动升级系统,可以自动升级安全补丁等。另外,我也期待它的手机客户端。原本也想自己开发的,但是 Discuz 官方都要出了,当然我还是想自己开发一个,因为可以在里面内建  Imgshow  插件!!!