Hi,

I'm having difficulty using this module and I'm wondering if there is a
mailing list where I can go to ask questions or barring that perhaps
someone will have some insight into the test code I've included below.
I took it from the example on CPAN.

Can you tell me what I'm doing wrong?

Bruce Ferrell


#!/usr/bin/perl
use strict;
use warnings;

use WWW::Mechanize;
use HTML::Form;
use HTTP::Cookies;
use WWW::Facebook::API;
use Data::Dumper;

#my $client = WWW::Facebook::API->new(

#                        desktop        => 1,
#                        throw_errors   => 1,
#                        parse          => 0,
#                        format         => 'XML',
#                      );

my $client = WWW::Facebook::API->new(
                     desktop           => 1,
                    api_key            => 'xxxxx',
                    secret              =>
'xxxxx',
                    debug              => 0,
                    throw_errors    => 1,
                    parse               => 0,
                     );

my $fbhome             = "fbhome.htm";
my $fbfriends             = "fbfriends.htm";

my $url             = "http://www.facebook.com/";;
my $username             = "user";
my $email             = "ma...@mail.com";
my $password             = "pwd123";

my $mech             = WWW::Mechanize->new();

my $name             = 'login_form';

my $testapi             = "xxxxx";
my $testsecret             = "xxxxx";

$mech->cookie_jar(HTTP::Cookies->new());

$mech->get( $url );

die "Can't get the form name: ", $mech->response->status_line unless
$mech->success;

$mech->field(email => $email);
$mech->field(pass => $password);
$mech->click();

# Change API key and secret
$client->api_key($testapi);
$client->secret($testsecret);

# not needed if web app (see $client->canvas->get_fb_params)

$client->auth->get_session( $client->auth->create_token );
--> error here

Error during REST auth.getSession call:
params =
        api_key:XXXXX
        auth_token:ba4be8e0f61ab6e52fe4356d2757fa3d
        call_id:1284400465.57999
        format:JSON
        method:facebook.auth.getSession
        v:1.0
response =
{"error_code":100,"error_msg":"Invalid
parameter","request_args":[{"key":"api_key","value":"XXXXX"},{"key":"auth_token","value":"XXXXX"},{"key":"call_id","value":"1284400465.57999"},{"key":"format","value":"JSON"},{"key":"method","value":"facebook.auth.getSession"},{"key":"v","value":"1.0"},{"key":"sig","value":"9120f7e3417919e36f1337522d387625"}]}




-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to