Facebook event gender with brute force.
The application uses the Facebook Graph API and is subject to limitations.
First of all, is required have an Facebook App See more
After, it's just put the id of app here app.js
:
window.fbAsyncInit = function() {
FB.init({
appId : '{ID_OF_YOUR_APP}',
xfbml : true,
version : 'v2.5'
});
};
make a login with an account and you have it.
More names... more you'll be able to map. It's very simple, is just a chain of assync functions.
function attCountName() {
FB.api('https://graph.facebook.com/'+$scope.eventId.value+'?fields=attending_count,name',
function (response) {
if (response && !response.error) {
$scope.eventAttendingCount = parseInt(response.attending_count);
$scope.eventname = response.name;
$scope.maleCount = 0;
$scope.femaleCount = 0;
$scope.mappedAttendings = 0;
$scope.$applyAsync();
}
}
);
}
function firstNamesReq() {
var def = $q.defer();
FB.api('https://graph.facebook.com/'+$scope.eventId.value+'/attending?pretty=0&limit='+1300,
function (response) {
if (response && !response.error){
hasNextNames(response);
calcNames(response.data);
$scope.$applyAsync();
def.resolve();
} else {
def.reject(response.error);
}
}
);
return def.promise;
}
function nextNames() {
if(eventNextNames != null){
FB.api(eventNextNames,
function (response) {
if (response && !response.error){
hasNextNames(response);
calcNames(response.data);
$scope.$applyAsync();
return nextNames();
}
});
} else {
$scope.mappedPercent = 100;
return null;
}
}
and the execution...
$scope.search = function() {
var chain = $q.when();
chain.then(attCountName())
.then(
firstNamesReq().then(function() {
nextNames();
}, function(reason) {
console.log(reason);
}));
};