GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Facebook::Graph::Publish::Post(3) User Contributed Perl Documentation Facebook::Graph::Publish::Post(3)

Facebook::Graph::Publish::Post - Publish to a user's wall.

version 1.0801

 my $fb = Facebook::Graph->new;

 $fb->add_post
    ->set_message('I like beer.')
    ->publish;

 my $response = $fb->add_post
    ->set_message('I like Perl.')
    ->set_picture_uri('http://www.perl.org/i/camel_head.png')
    ->set_link_uri('http://www.perl.org/')
    ->set_link_name('Perl.org')
    ->set_link_caption('Perl is a programming language.')
    ->set_link_description('A link to the Perl web site.')
    ->publish;

This module gives you quick and easy access to publish to a user's Facebook feed.

ATTENTION: You must have the "publish_stream" privilege to use this module.

TIP: Facebook seems to use these terms interchangeably: Feed, Post, News, Wall. So if you want to publish to a user's wall, this is the mechanism you use to do that.

Specify a profile id to post to. Defaults to 'me', which is the currently logged in user.

Sets the text to post to the wall.

message

A string of text.

Sets the URI of a picture to be displayed in the message.

uri

A URI to a picture.

Sets the URI of a link that viewers can click on for more information about whatever you posted in "set_message".

uri

A URI to a site.

If you want to give the link you set in "set_link_uri" a human friendly name, use this method.

A text string to be used as the name of the link.
Sets a short blurb to be displayed below the link/picture.

caption

A text string.

Sets a longer description of the site you're linking to. Can also be a portion of the article you're linking to.

description

A text string.

Sets a source URI for a flash or video file.

uri

The URI you wish to set. For example if you wanted to include a YouTube video:

 $post->set_source('http://www.youtube.com/watch?v=efsJRdJ6dog');

Sets a list of actions (or links) that should go in the post as things people can do with the post. This allows for integration of the post with third party sites.

actions

An array reference of hash references containing "name" / "link" pairs.

 $post->actions([
    {
        name    => 'Click Me!',
        link    => 'http://www.somesite.com/click',
    },
    ...
 ]);
Adds an action to the list of actions set either by previously calling "add_action" or by calling "set_actions".

name

The name of the action (the clickable label).

link

The URI of the action.

A completely optional privacy setting.

"property" values assigned when the post is published. This is typically rendered as a list of links.

    $post->set_properties( { "search engine:" => { "text" => "Google", "href" => "http://www.google.com/" } } );

setting

The privacy setting. Choose from: EVERYONE, CUSTOM, ALL_FRIENDS, NETWORKS_FRIENDS, and FRIENDS_OF_FRIENDS. See <http://developers.facebook.com/docs/reference/api/post> for changes in this list.

options

A hash reference of options to tweak the privacy setting. Some options are required depending on what privacy setting you chose. See <http://developers.facebook.com/docs/reference/api/post> for details.

 $post->set_privacy('CUSTOM', { friends => 'SOME_FRIENDS', allow => [qw( 119393 993322 )] });
friends
A string that must be one of EVERYONE, NETWORKS_FRIENDS, FRIENDS_OF_FRIENDS, ALL_FRIENDS, SOME_FRIENDS, SELF, or NO_FRIENDS.
networks
An array reference of network ids.
allow
An array reference of user ids.
deny.
An array reference of user ids.

Makes a post only available to viewers in certain countries.

 $post->set_target_countries( ['US'] );

countries

An array reference of two letter country codes (upper case). You can find a list of country codes in the list of city ids here: <http://developers.facebook.com/attachment/all_cities_final.csv>.

Makes a post only available to viewers in certain regions.

 $post->set_target_regions( [6,53] );

regions

An array reference of region numbers however Facebook defines that. I've got no idea because their documentation sucks. I'm not even sure what a region is. Is it a region of a country? Of a continent? No idea. I do know it is an integer, but that's about it.

Makes a post only available to viewers in certain cities.

 $post->set_target_cities( [2547804] );

cities

An array reference of cities ids. In the example above I've listed Madison, WI. You can find a list of their cities here: <http://developers.facebook.com/attachment/all_cities_final.csv>

Makes a post only available to viewers in certain locales.

 $post->set_target_locales( [6] );

locales

An array reference of locales ids. You can find their list of locales here: <http://developers.facebook.com/attachment/locales_final.csv>

Posts the data and returns a Facebook::Graph::Response object. The response object should contain the id:

 {"id":"1647395831_130068550371568"}

Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
2014-09-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.