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?


In reply to need help with WWW::Facebook::API by Special_K

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.