Group
Extension

Matches 10

Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph.pm ( view source; MetaCPAN )
::Graph;
$Facebook::Graph::VERSION = '1.1205';
use Moo;
use 5.006;
use MIME::Base64::URLSafe;
use JSON;
use Facebook::Graph::AccessToken;
use Facebook::Graph::Authorize;
use Facebook::Graph::Query;
us
load) = split(/\./, $signed_request);

	my $sig = urlsafe_b64decode($encoded_sig);
    my $data = JSON->new->decode(urlsafe_b64decode($payload));

    if (uc($data->{'algorithm'}) ne "HMAC-SHA256") {
sha256($payload, $self->secret);
    if ($sig ne $expected_sig) {
        ouch '500', 'Bad Signed JSON signature!';
    }
    return $data;
}

sub request_access_token {
    my ($self, $code) = @_;
  
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Publish/Post.pm ( view source; MetaCPAN )
s_actions) {
        foreach my $action (@{$self->actions}) {
            push @$post, actions => JSON->new->encode($action);
        }
    }
    if ($self->has_privacy) {
        my %privacy = %{$sel
new->encode(\%privacy);
    }
    if ($self->has_properties) {
        push @$post, properties => JSON->new->encode($self->properties);
    }
    return $post;
};

1;

=head1 NAME

Facebook::Graph::Pu
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Session.pm ( view source; MetaCPAN )
uest to Facebook to fetch an access token. Returns a L<Facebook::Graph::Response> object. Example JSON response:

=head1 LEGAL

Facebook::Graph is Copyright 2010 - 2017 Plain Black Corporation (L<http
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Response.pm ( view source; MetaCPAN )
package Facebook::Graph::Response;
$Facebook::Graph::Response::VERSION = '1.1205';
use Moo;
use JSON;
use Ouch;

has response => (
    is      => 'rw',
    isa     => sub {ouch(442,"$_[0] is not an HT
ult => sub {
        my $self = shift;
        return $self->response->content;
    },
);

has as_json => (
    is      => 'ro',
    lazy    => 1,
    default => sub {
        my $self = shift;
      
    }
        else {
            my $message = $response->message;
            my $error = eval { JSON->new->decode($response->content) };
            unless ($@) {
                $message = $error->
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/BatchRequests.pm ( view source; MetaCPAN )
lf->add_request($_) foreach @reqs;

    my $json = JSON->new;
    my $post = {
        access_token => $self->access_token, # required
        batch => $json->encode($self->requests),
    };

    $sel
   unless ($resp->is_success) {
        my $message = $resp->message;
        my $error = eval { $json->decode($resp->content) };
        unless ($@) {
            $message = $error->{error}{type} . '
ould not execute batch requests: $message";
    }

    my $data = $json->decode($resp->decoded_content);
    map { $_->{data} = $json->decode($_->{body}) } @$data;
    return wantarray ? @$data : $dat
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/AccessToken/Response.pm ( view source; MetaCPAN )
::AccessToken::Response::VERSION = '1.1205';
use Moo;
use URI;
use URI::QueryParam;
use Ouch;
use JSON;

has response => (
    is      => 'ro',
    required=> 1,
);

has token => (
    is      => 'ro'
sponse->content =~ m/\A { .+ } \z/xm) {
                # From v2.3 they return JSON object.
                return JSON->new->decode($response->content)->{access_token};
            }
            els
sponse->content =~ m/\A { .+ } \z/xm) {
                # From v2.3 they return JSON object.
                return JSON->new->decode($response->content)->{expires_in};
            }
            else 
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Publish/Checkin.pm ( view source; MetaCPAN )

    }
    if ($self->has_latitude && $self->has_longitude) {
        push @$post, coordinates => JSON->new->encode({ latitude => $self->latitude, longitude => $self->longitude });
    }
   return $po
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Cookbook/Recipe1.pod ( view source; MetaCPAN )
irectly in the code. This is a terrible practice. Instead use a config file system like L<Config::JSON> to store your settings.

=head2 Assumptions

This recipe assumes that you know and have L<Plack>
'user')
            ->limit_results(10)
            ->request;
        $out .= eval{$response->as_json};
        if ($@) {
            $out .= 'ERROR: '.$@->[1];
        }
    }

    # close everythin
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Cookbook/Recipe3.pod ( view source; MetaCPAN )
n access token.

=head1 RECIPE

 use Facebook::Graph;
 use Ouch;
 use Config::JSON;

 # init
 my $fb_config = Config::JSON->new('/path/to/my.conf')->get('facebook');
 my $fb = Facebook::Graph->new($fb
Facebook-Graph ( R/RI/RIZEN/Facebook-Graph-1.1205.tar.gz, RIZEN, 2019; MetaCPAN )
Facebook-Graph/lib/Facebook/Graph/Request.pm ( view source; MetaCPAN )
package Facebook::Graph::Request;
$Facebook::Graph::Request::VERSION = '1.1205';
use Moo;
use JSON;
use Ouch;
use LWP::UserAgent;
use LWP::Protocol::https;
use Facebook::Graph::Response;

has ua => (

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.