May 5, 2014

Failed plenv install-cpanm and ended up installing curl with --with-openssl option

Today I tried `plenv install-cpanm` and it failed. I do remember it worked fine a couple of month ago and the only thing I can think of was that I did `yum update openssl` last month. I'm pretty sure I didn't do anything else nasty.

I searched and found someone with same problem. I followed what he did as shown below: Then I succeeded to run plenv install-cpanm
% plenv install-cpanm      
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   303    0   303    0     0    509      0 --:--:-- --:--:-- --:--:--  7973
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100  262k  100  262k    0     0   113k      0  0:00:02  0:00:02 --:--:-- 3012k
--> Working on App::cpanminus
Fetching ... OK
Configuring App-cpanminus-1.7004 ... OK
Building and testing App-cpanminus-1.7004 ... OK
Successfully installed App-cpanminus-1.7004
1 distribution installed

May 3, 2014

Facebook::OpenGraph Ver.1.21 supports API versioning

On 2014-04-30 Facebook announced API versioning to improve its stability. Each version is guaranteed to work 2 years so we do not have to be afraid of 90 day breaking change policy anymore. The version we were using prior to this introduction is called version 1.0 while the new version introduced along with API versioning policy is called version 2.0.

Versioned Request

Making versioned request is pretty easy. Just like other major platform APIs, you prepend version number to the end point like below:
Unversioned request is also supported. Just don't prepend version number and it's considered "unversioned." The document says "An unversioned call will default to the oldest available version of the API," but here is one tricky part:
For apps that existed before April 30th 2014, making an API call without specifying a version number ('unversioned') is equivalent to making a call to the v1.0 of the API.
For apps created on or after April 30th 2014, making an API call without a specifing a version number is equivalent to making a call to v2.0 of the API.
So when you are making unversioned request, just be careful when the request app was created.

Facebook::OpenGraph 1.21

I implemented versioning support to Facebook::OpenGraph and launched it as Ver. 1.21. This change is backward compatible. If you update module and don't make any change to your code it makes unversioned request, which is exactly the same as previous version of this module.

API Versioning

With this version, you can specify default version on initialization as follows:
my $fb = Facebook::OpenGraph->new(+{
    app_id  => 12345,
    secret  => 'qwerty',
    version => 'v2.0',
If you don't specify any version,  version is left undef and each request becomes unversioned request.
You can still set version on each request by specifying versioned path such as /v1.0/me/friends. This will override the version configuration given on initialization.
my $fb = Facebook::OpenGraph->new(+{version => 'v2.0'});
$fb->get('/zuck');      # Use version 2.0 by accessing /v2.0/zuck
$fb->get('/v1.0/zuck'); # Ignore the default version and use version 1.0
my $fb = Facebook::OpenGraph->new();
$fb->get('/zuck'); # Unversioned API access since version is not specified
                   # on initialisation or each reqeust.

Dialog Versioning

Facebook Platform also supports dialog versioning. If you specify version -- let's say v2.0 -- on initialization, $fb->auth_uri() will return versioned Login dialog URL like

If you have any enhancement idea, bug fix or question. Feel free to add an issue.