2

これでエラーは発生しませんが、ファンページの壁には投稿されません。これでいくつかの助けが大好きです! 自分でこれを理解しようとするのはジェットコースターでした.

もちろん、正しいトークンでテストされています。

#!/usr/bin/perl

use strict;
use warnings;
use open qw(:std :utf8);
use LWP::Simple;
use YAML::Tiny;
use JSON;
use URI;
use utf8;

my $access_token = 'blah';
my $profile_id = '200117706712975';

#Publish to a facebook page as admin
graph_api('/' . $profile_id . '/feed',{
        access_token => $access_token,
        message => 'this is a test!',
        link => 'http://test.com',
        method => 'post'
});

exit 0;

sub graph_api {
  my $uri = new URI('https://graph.facebook.com/' . shift);
  $uri->query_form(shift);
  my $resp = get("$uri");
  return defined $resp ? decode_json($resp) : undef;
}
4

1 に答える 1