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::Query(3) User Contributed Perl Documentation Facebook::Graph::Query(3)

Facebook::Graph::Query - Simple and fast searching and fetching of Facebook data.

version 1.0801

 my $fb = Facebook::Graph->new;
 
 my $perl_page = $fb->query->find('16665510298')
    ->include_metadata
    ->request
    ->as_hashref;
 
 my $sarah_bownds = $fb->query->find('sarahbownds')
    ->select_fields(qw(id name))
    ->request
    ->as_hashref;

 # this one would require an access token
 my $new_years_posts = $fb->query
    ->from('posts')
    ->where_since('1 January 2011')
    ->where_until('2 January 2011')
    ->limit(25)
    ->date_format('U')
    ->request
    ->as_hashref;

 # this one would require an access token
 my $new_car_posts = $fb->query
    ->search('car', 'my_news')
    ->where_since('yesterday')
    ->request
    ->as_hashref;

This module presents a programatic approach to building the queries necessary to search and retrieve Facebook data. It provides an almost SQL like way of writing queries using code. For example:

 my $results = $fb
    ->select_fields(qw(id name))
    ->search('Dave','user')
    ->where_since('yesterday')
    ->limit_results(25)
    ->request
    ->as_hashref;

The above query, if you were read it like text, says: "Give me the user ids and full names of all users named Dave that have been created since yesterday, and limit the result set to the first 25."

Fetch a single item.

id

The unique id or object name of an object.

Example: For user "Sarah Bownds" you could use either her profile id "sarahbownds" or her object id 767598108.

If you prefer to search by keyword see the "search" method.

context

One of the following contexts:

my_news
The current user's news feed (home page). Requires that you have an access_token so you know who the current user is.
post
All public posts.
user
All people.
page
All pages.
event
All events.
group
All groups.

Perform a keyword search on a group of items.

If you prefer not to search by keyword see the "from" method.

query

They keywords to search by.

context

See the "context" param in the "from" method.

The result set will only return a certain number of records when this is set. Useful for paging result sets. Returns $self for method chaining.

The result set dates will be formatted in the defined formats. Specify the format by reference the PHP date format spec: <http://php.net/manual/en/function.date.php>. (eg. ->date_format('U')->) Useful for getting epoch for datatime. Returns $self for method chaining.

amount

An integer representing the number of records to be returned.

Skips ahead the result set by the amount. Useful for paging result sets. Is only applied when used in combination with "limit_results". Returns $self for method chaining.

amount

An integer representing the amount to offset the results by.

Adds metadata to the result set including things like connections to other objects and the object type being returned. Returns $self for method chaining.

include

Defaults to 1 when the method is called, but defaults to 0 if the method is never called. You may set it specifically by passing in a 1 or 0.

Limit the result set to only include the specific fields if they exist in the objects in the result set. Returns $self for method chaining. May be called multiple times to add more fields.

fields

An array of fields you want in the result set.

Example: 'id', 'name', 'picture'

Limit the result set to these specifically identified objects. Returns $self for method chaining. May be called multiple times to add more ids.

ids

An array of object ids, object names, or URIs.

Example: 'http://www.thegamecrafter.com/', 'sarahbownds', '16665510298'

Include only records that were created before "date". Returns $self for method chaining.

date

Anything accepted by PHP's strtotime function <http://php.net/manual/en/function.strtotime.php>.

Include only records that have been created since "date". Returns $self for method chaining.

date

Anything accepted by PHP's strtotime function <http://php.net/manual/en/function.strtotime.php>.

Returns a URI string based upon all the methods you've called so far on the query. Mainly useful for debugging. Usually you want to call "request" and have it fetch the data for you.

Forms a URI string based on every method you've called so far, and fetches the data. Returns a Facebook::Graph::Response object.

uri

Optionally pass in your own URI string and all the other options will be ignored. This is mainly useful with metadata connections. See "include_metadata" for details.

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.