Using Facebook to build a fan base for a business or website has become customary in this day and age. The problem, however, is that Facebook offers no integrated tools for exporting group or page fan data. To export fans from a group, you can use the third-party "Export group members to .csv" application, but to export fans from a page, you will need to run a custom query in Google Chrome.
Access the "Export group members to .csv" application page and click the "Go to app" button.
Type the group id into the textbox, check the data you would like included in the report -- Facebook ID, Last Name, First Name, Full Name -- and click the "Create csv" button.
Open the file in Microsoft Excel to access the data you just exported.
Export Page Fans
Open Google Chrome, log into your Facebook account and load up your page.
Click the wrench-shaped icon in the upper right corner and select the "Developer tools" option from the Tools menu.
Click the double-right arrow icon at the bottom of the browser and select the "Console" option. The arrow icon can be found to the right of the other Developer Tool icons, including Elements, Resources, Network, Scripts and Timeline.
Copy and paste the following JavaScript code into the console and press enter:
var uri = '/ajax/social_graph/fetch.php?__a=1';
var lastResponse = null;
var usersPerPage = 100;
var totalUsersDownloaded = 0;
var throttle = 3000; // how long to wait between pages
var startPage = 0;
var endPage = 10; // change this if you have more than 1,000 fans
// Find the social graph node ID (page profile ID) by peeking at meta tags
var getNodeId = function() {
var metaTags = document.getElementsByTagName('meta');
for (i in metaTags) {
var tag = metaTags[i];
if (tag.content && tag.content.match(/_([0-9]+)_/)) {
return tag.content.match(/_([0-9]+)_/)[1];
}
}
return null;
}
// Process the AJAX call response and dump the user data to the console
var OnResponse = function(e) {
console.log('--- Page: ' + e.payload.page);
lastResponse = e; // for debugging
for (userId in e.payload.user_info) {
var userData = e.payload.user_info[userId];
totalUsersDownloaded++;
console.log(userId + ',' + userData.title + ',' + userData.subtitle + ',' + userData.pic)
}
console.log('Downloaded: ' + totalUsersDownloaded + ' of ' + e.payload.count)
if (e.payload.page <= endPage && totalUsersDownloaded < e.payload.count) {
setTimeout(function() { downloadUsers(e.payload.page + 1); }, 3000);
}
}
// Make an AJAX call for the data using FB's AJAX library
var downloadUsers = function(page) {
var nodeId = getNodeId();
if (!nodeId) {
alert('Sorry couldn\'t find profile ID');
return;
}
var data = {
edge_type: 'fan',
page: page,
limit: usersPerPage,
node_id: nodeId,
'class': 'FanManager',
post_form_id: document.getElementById('post_form_id').value,
fb_dtsg: document.getElementsByName('fb_dtsg')[0].value,
lsd: null,
post_form_id_source: 'AsyncRequest'
}
var req = new AsyncRequest()
.setURI(new URI(uri))
.setMethod('POST')
.setData(data)
.setHandler(OnResponse);
result = req.send();
}
downloadUsers(startPage);
Copy the fan data from the console to Microsoft Word, Notebook or whatever software package you would like to use to store it.
Read more : http://www.ehow.com/how_12056467_export-facebook-fans.html
Access the "Export group members to .csv" application page and click the "Go to app" button.
Type the group id into the textbox, check the data you would like included in the report -- Facebook ID, Last Name, First Name, Full Name -- and click the "Create csv" button.
Open the file in Microsoft Excel to access the data you just exported.
Export Page Fans
Open Google Chrome, log into your Facebook account and load up your page.
Click the wrench-shaped icon in the upper right corner and select the "Developer tools" option from the Tools menu.
Click the double-right arrow icon at the bottom of the browser and select the "Console" option. The arrow icon can be found to the right of the other Developer Tool icons, including Elements, Resources, Network, Scripts and Timeline.
Copy and paste the following JavaScript code into the console and press enter:
var uri = '/ajax/social_graph/fetch.php?__a=1';
var lastResponse = null;
var usersPerPage = 100;
var totalUsersDownloaded = 0;
var throttle = 3000; // how long to wait between pages
var startPage = 0;
var endPage = 10; // change this if you have more than 1,000 fans
// Find the social graph node ID (page profile ID) by peeking at meta tags
var getNodeId = function() {
var metaTags = document.getElementsByTagName('meta');
for (i in metaTags) {
var tag = metaTags[i];
if (tag.content && tag.content.match(/_([0-9]+)_/)) {
return tag.content.match(/_([0-9]+)_/)[1];
}
}
return null;
}
// Process the AJAX call response and dump the user data to the console
var OnResponse = function(e) {
console.log('--- Page: ' + e.payload.page);
lastResponse = e; // for debugging
for (userId in e.payload.user_info) {
var userData = e.payload.user_info[userId];
totalUsersDownloaded++;
console.log(userId + ',' + userData.title + ',' + userData.subtitle + ',' + userData.pic)
}
console.log('Downloaded: ' + totalUsersDownloaded + ' of ' + e.payload.count)
if (e.payload.page <= endPage && totalUsersDownloaded < e.payload.count) {
setTimeout(function() { downloadUsers(e.payload.page + 1); }, 3000);
}
}
// Make an AJAX call for the data using FB's AJAX library
var downloadUsers = function(page) {
var nodeId = getNodeId();
if (!nodeId) {
alert('Sorry couldn\'t find profile ID');
return;
}
var data = {
edge_type: 'fan',
page: page,
limit: usersPerPage,
node_id: nodeId,
'class': 'FanManager',
post_form_id: document.getElementById('post_form_id').value,
fb_dtsg: document.getElementsByName('fb_dtsg')[0].value,
lsd: null,
post_form_id_source: 'AsyncRequest'
}
var req = new AsyncRequest()
.setURI(new URI(uri))
.setMethod('POST')
.setData(data)
.setHandler(OnResponse);
result = req.send();
}
downloadUsers(startPage);
Copy the fan data from the console to Microsoft Word, Notebook or whatever software package you would like to use to store it.
Read more : http://www.ehow.com/how_12056467_export-facebook-fans.html