CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Perl Facebook::Graph posting AS Page, not as Admin/User

 



perl4ever
New User

Dec 7, 2013, 6:36 AM

Post #1 of 1 (10178 views)
Perl Facebook::Graph posting AS Page, not as Admin/User Can't Post

Using the Perl module, Facebook::Graph, I have created some basic perl code that can post to my own wall. I can share a photo on my own wall. I can also post a simple wall message to one of the pages for which I am an admin. However, when I try to post a photo to the page, it posts as me, not as the page.

Here is the sample code that posts as me, to the Facebook page. I need it to post as the Page, not as me.


Code
# previously, I obtained my Page's accesstoken, and other credentials 
# including the Facebook Page ID

my $fb = Facebook::Graph->new(
app_id => $facebook_application_id,
secret => $facebook_application_secret
);

$fb->access_token($facebook_accesstoken);

my $rstring = $fb
->add_photo
->to($facebookPageID)
->set_message('Look at this really cool photo!')
->set_source('./raw_image_example.jpg')
->publish
->as_string;

print "$rstring\n\n";


I am trying to figure out how to create a post to the wall of a Facebook page, as if it is being posted BY the page, not by me.

I am trying to do that with the CPAN module, Facebook::Graph (see CPAN: http://search.cpan.org/~rizen/Facebook-Graph-1.0600/ )

I cannot, for the life of me, figure this out. Any help would be most welcomed!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives