You can see some screen shots and info on the demo app
here.
Usage
The Facebook for Pages connector attempts to download all Feeditems (including comments) and all available user information for posters and commentors for the specified Facebook page.
Please note that we are only able to return the data provided by the Facebook graph API - any discrepncies are due to the Facebook graph API and the data it returns.
Facebook Name or Page Id
You will need to enter the name or id of the Facebook page into the textbox highlighted below before using this connector:

To establish this, browse to the Facebook page you wish to access. If the Facebook page has a 'vanity' URL like this:

The you should enter this value into the text box.
Otherwise it will probably look something more like the following, in which case you should enter the highlighted numeric identifier into QVSource:

Facebook Pages Only
Please note the connector is designed to work with Facebook pages only. For example in the following screen shot we are searching for iPhone - only the top entry (in green) is applicable for this connector, the other entry (in red) is an App (rather than a Facebook page) and may cause issues when used with this connector (although you may still be able to get a lot of useful data!).

Tables
The following tables are supplied by the connector. These should provide you with everything you need to get all the feed items, comments on those items and users who made those posts and comments as well as page level info such as like count.

The FeedItems table is the main starting point. In this example we get the most 10 recent FeedItems for the QlikView Facebook page:

We now have a list of post and poster ids which we can pass to other tables:

Notice that the max number of feed items count parameter entered earlier is passed to the QlikView, as well as the Facebook page id:

In general the configuration information entered in the QVSource UI is converted into parameters in the load script so they can be modified during the reload process. This is part of what makes QVSource so powerful!
To generate the script to extract a single poster's information lets pick a poster id.

We now copy and paste this value into the User ID field on the connector's config form:

This value will then be passed to the User table:

As you can see on the load script tab:

Now all we need to do is modify our load script to loop through each feed item and extract the data for each user. The following script illustrates this. The first load statement grabs the most recent set of feed items, the second loop grabs the data for the poster of each of these items:
FacebookFanPagesConnector_FeedItems:
LOAD
page as page,
feeditem_id as feeditem_id,
poster_id as poster_id,
type as FeedItems_type,
message as FeedItems_message,
picture as FeedItems_picture,
link as FeedItems_link,
name as FeedItems_name,
caption as FeedItems_caption,
description as FeedItems_description,
icon as FeedItems_icon,
created as FeedItems_created,
date#(created, 'YYYY-MM-DDThh:mm:ss+0000') as FeedItems_created_qvdatetime,
date#(subfield(created, 'T', 1), 'YYYY-MM-DD') as FeedItems_created_qvdate,
time#(subfield(created, 'T', 2), 'hh:mm:ss+0000') as FeedItems_created_qvtime,
updated as FeedItems_updated,
date#(updated, 'YYYY-MM-DDThh:mm:ss+0000') as FeedItems_updated_qvdatetime,
date#(subfield(updated, 'T', 1), 'YYYY-MM-DD') as FeedItems_updated_qvdate,
time#(subfield(updated, 'T', 2), 'hh:mm:ss+0000') as FeedItems_updated_qvtime,
object_id as FeedItems_object_id,
likes_count as FeedItems_likes_count,
comments_count as FeedItems_comments_count
FROM
[http://localhost:5555/QVSource/FacebookFanPagesConnector/?table=FeedItems&FacebookPageOrId=qlikview&MaxNumberOfItems=10&format=html]
(html, codepage is 1252, embedded labels, table is @1);
LET noRows = NoOfRows('FacebookFanPagesConnector_FeedItems');
for i=0 to $(noRows)-1 // loop through every row
let posterID = peek('poster_id', $(i), 'FacebookFanPagesConnector_FeedItems');
let posterIDExists = exists('posterExistsKey',posterID);
if posterIDExists <> -1 then
FacebookFanPagesConnector_Posters:
LOAD
user_id as posterExistsKey,
user_id as poster_id,
name as Posters_name,
first_name as Posters_first_name,
middle_name as Posters_middle_name,
last_name as Posters_last_name,
link as Posters_link,
username as Posters_username,
gender as Posters_gender,
locale as Posters_locale,
updated_time as Posters_updated_time,
picture as Posters_picture,
likes as Posters_likes,
category as Posters_category,
website as Posters_website,
founded as Posters_founded,
company_overview as Posters_company_overview,
mission as Posters_mission,
products as Posters_products,
can_post as Posters_can_post,
location_street as Posters_location_street,
location_city as Posters_location_city,
location_state as Posters_location_state,
location_country as Posters_location_country,
location_zip as Posters_location_zip,
location_latitude as Posters_location_latitude,
location_longitude as Posters_location_longitude,
phone as Posters_phone,
awards as Posters_awards,
hometown as Posters_hometown,
bio as Posters_bio,
work as Posters_work,
education as Posters_education,
interested_in as Posters_interested_in,
relationship_status as Posters_relationship_status,
significant_other as Posters_significant_other,
description as Posters_description,
general_info as Posters_general_info
FROM
[http://localhost:5555/QVSource/FacebookFanPagesConnector/?table=User&UserId=14400365202&format=html]
(html, codepage is 1252, embedded labels, table is @1);
end if
next
Resulting in the following schema:

You can download this QVW file
here.
You can use exactly the same principle to extract the comments for each feed item and associated commentor for each comment, see our
demo application for a complete example of this.
Clearing the Cache for Specific Facebook Pages
If you would like to clear the cache just for a certain facebook page, you can use something similar to the following. Simply replace [pagename_or_id] with the value in the left column of your inline load script which specified the Facebook pages. This is also discussed
here.
LOAD QVSource_ClearCache_Result
FROM
[http://localhost:5555/QVSource/FacebookFanPagesConnector/?clearcache=true&clearcache_searchPattern=[pagename_or_id]_*]
(txt, utf8, embedded labels, delimiter is '\t', msq);
Common Questions
- Can I get the list of users who liked my fan page?
Unfortunately this is not currently supported by the Facebook Graph API (see this post) and so is not something which we can support yet in QVSource either.
Change Log
1.1.3 - 06/05/2012
- Added shares_count, from_name, from_category and source columns to feed items table.
1.1.2 - 12/04/2012
- Authentication procedure will now inform user if token has an expiry date and recommend that they set a note to remind them to reauthenticate with the connector before this time.
- Added CheckAccessToken table.
1.1.1 - 27/03/2012
- Since date parameter was only being recognised in the feed table. Should work across other tables now (which have a created_date column).
1.1.0 - 19/03/2012
- Added new Milestones table.
- LikesForItem and TaggedForItem tables now show error if no object id is specified.
- SearchFor??? tables now show error if no search term is specified.
- The CommentsForItem table now supports the since date input.
1.0.9 - 02/03/2012
- Feed items now returned in pages of 100 items each instead of 25.
- Comments, Posters and Commentors tables are no longer supported for performance reasons. This data can be extracted using the CommentsForItem, FeedItems and User tables which is illustrated in the online demo app on the wiki.
1.0.8 - 24/02/2012
- comments_count removed from SearchForPosts (it never actually existed in the results).
- likes_count in SearchForPosts now returns count rather than data.
1.0.7 - 20/02/2012
- Added first version of SearchForPages, SearchForPeople and SearchForPosts tables.
1.0.6 - 04/02/2012
- MaxNumberOfItems parameter now correctly placed in generated QlikView script for LikesForItem table.
- New TaggedForItem table added.
- Improved tidying up of resources (DataTables) after use.
1.0.5 - 31/01/2012
- Minor tidy up for authentication code. expires_in parameter no longer erroneously part of token (although this was not causing any issues).
- When authenticating, permissions or now requested to read subscribers and subscribedto tables (although these do not seem to be working yet in the API).
- Fixed tab order.
1.0.4 - 11/01/2012
- Fixed an issue where the request for the feeditems from the QlikView fan page (e.g. // http://localhost:5555/QVSource/FacebookFanPagesConnector/?table=FeedItems&FacebookPageOrId=QlikView&MaxNumberOfItems=-1&format=html) was resulting in an error message being returned as well as valid data. This has only been observed for this particular Fan page and request but may have been affecting others too. If this error occurs it will be written to the event log but QVSource will return as much data correctly as it can.
- Minor change to contents logged when API call tracking is turned on.
1.0.3 - 04/01/2012
- Fixed issue in LikesForItem table.
1.0.2 - 29/11/2011
- Added LikesForItem table.
1.0.1 - 29/11/2011
- User table no longer errors if Facebook returns 'false' for the requested user, just returns an empty table.
1.0.0 - 19/11/2011
- First non beta release.
- FacebookProConnector now referred to as FacebookFanPagesConnector in load script.
0.9.2 - 08/11/2011
- Now referred to FacebookProConnector rather than IndustrialCodeBox_FacebookProConnector in load script.
- MaxNumberOfFeedItems parameter now named MaxNumberOfItems as it is shared between feed and comments tables.
- Added an option to select a date threshold for feed items.
0.9.1 - 26/10/2011
- Added CommentsForItem table.
- Added User table (this was present in the table list before but not working).
- Removed the Posters and Commentors tables from the list (they are still supported in the background for the time being but considered deprecated.
0.9.0 - 08/10/2011
API Status
APIs are not error free or always 100% available. If you are having issues with the connector please first check that there are no problems at the API end point.
http://developers.facebook.com/live_status/Also - if you are experiencing an issue with the connector (for example after it was previously working ok) you might also try searching on the
Facebook bug tracker for recent bugs which might explain the experience you are having. This will probably be the first place we will look after checking the
API status.
Links
Facebook's official guide to building your business with Facebook pages:
http://ads.ak.facebook.com/ads/FacebookAds/FB_PagesGuide_MediaKit_051611.pdfUnofficial wiki for developers working with the Facebook platform.