Special_K has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm brand new to using the WWW::Facebook::API and am trying to write a simple program to access my friends list. I'm not even trying to build a web interface at this point - I'm trying to do everything from the command line. I have already registered my application on the Facebook developers website and have my API key and secret key. Here is the code I have so far:

#!/usr/bin/perl -w use strict; use WWW::Facebook::API; use Data::Dumper; my $api_key = '###############'; my $secret = '################################'; my $client = WWW::Facebook::API->new( desktop => 0, api_key => $api_key, secret => $secret, ); $client->auth->get_session( $client->auth->create_token); my $friends_perl = $client->friends->get; print Dumper $friends_perl;

Running the above generates the following:

Error during REST auth.getSession call: params = api_key:593556437357708 auth_token:ff943e34a13a09db5183759758c1114e call_id:1379735054.13075 format:JSON method:facebook.auth.getSession v:1.0 response = {"error_code":100,"error_msg":"Invalid parameter","request_args":[{"ke +y":"api_key","value":"593556437357708"},{"key":"auth_token","value":" +ff943e34a13a09db5183759758c1114e"},{"key":"call_id","value":"13797350 +54.13075"},{"key":"format","value":"JSON"},{"key":"method","value":"f +acebook.auth.getSession"},{"key":"v","value":"1.0"},{"key":"sig","val +ue":"413ab39f44795539e74abd4de1be79ed"}]}

I'm not even sure where to start on this one. I know the WWW::Facebook::API has several other input parameters. Do I need to specify session_key, session_expires, session_uid? Does the fact that I'm only interested in using this app from the command line for now make a difference? Also I'm only interested in accessing my own data. Can I hard code my login info into the script somehow?

Replies are listed 'Best First'.
Re: need help with WWW::Facebook::API
by Anonymous Monk on Sep 21, 2013 at 05:04 UTC
      Wow, good find. That probably saved me a few hours of debug work. It looks like WWW:Facebook::API hasn't been updated since 2010. I'll try Facebook::Graph instead, unless there actually is a solution to my original question.