WWW-Facebook-API
view release on metacpan or search on metacpan
examples/web-app.pl view on Meta::CPAN
sub find_action_for {
my $facebook = shift;
my ( $action, $uid );
($action) = ( $facebook->query->path_info =~ m[^/(\w+)] );
if ( exists $ENV{'QUERY_STRING'} ) {
($uid) = $ENV{'QUERY_STRING'} =~ /\bid=([^&]+)/;
}
if ( my $s = $action_map{$action} ) {
my @args = split m[(?<!\\)/],
( $facebook->query->path_info =~ m[^/(?:\w+)/(.*)] )[0];
@args = () unless @args;
$uid ||= $facebook->session_uid;
$s->( $facebook, $uid, @args );
}
else {
print '<fb:error>'
."<fb:message>I don't know how to do $action</fb:message>"
.'</fb:error>';
lib/WWW/Facebook/API.pm view on Meta::CPAN
my $self = shift;
my $app_path = shift;
my %ENV_VARS = @_;
open my $config, '<', $self->{'config'} ## no critic
or croak "Cannot open $self->{'config'}";
while (<$config>) {
carp "Config line: $_" if $self->{'debug'};
chomp;
my ( $key, $val ) = split m/=/xms, $_, 2;
next if !$key;
carp "Key/Val pair: $key -> $val" if $self->{'debug'};
for ( $key, $val ) {
s/\A\s+//xms;
s/\s+\Z//xms;
}
$ENV{$key} ||= $val;
}
close $config or croak "Cannot close $self->{'config'}";
( run in 2.742 seconds using v1.01-cache-2.11-cpan-71847e10f99 )