#!/usr/bin/perl -w
use WWW::Facebook::API;
use WWW::Facebook::API::Auth;
use WWW::Facebook::API::Canvas;
use HTTP::Request;
use LWP;
use CGI; # load CGI routines
$q = CGI->new; # create new CGI object
print $q->header, # create the HTTP header
$q->start_html('Facebook App'), # start the HTML
$q->h1('Facebook Authentication'), # level 1 header
$q->end_html; # end the HTML
my $facebook_api = '-------------';
my $facebook_secret = '----------------';
my $facebook_clientid = '---------------------';
my $client = WWW::Facebook::API->new(
desktop => 0,
api_version => '1.0',
api_key => $facebook_api,
secret => $facebook_secret,
callback => 'http://localhost/perl/facebook.pl',
);
$client->app_id($facebook_clientid);
$q->redirect($client->get_login_url());
登录到 facebook 后,回调 url 不起作用,导致 facebook 应用程序正在建设中。我不想在 facebook 本身中指定回调 url。我想在源代码中指定回调。