angular-facebook-api-factory is an angularjs module with a facebook api factory.
Author: Jonathan Hornung (JohnnyTheTank)
- Install via either bower, npm or downloaded files:
bower install --save angular-facebook-api-factory
npm install --save angular-facebook-api-factory
- download angular-facebook-api-factory.zip
- Add
jtt_facebook
to your application's module dependencies. - Include dependencies in your HTML.
- When using bower:
<script src="bower_components/angular-facebook-api-factory/dist/angular-facebook-api-factory.min.js"></script>
- When using npm:
<script src="node_modules/angular-facebook-api-factory/dist/angular-facebook-api-factory.min.js"></script>
- when using downloaded files
<script src="angular-facebook-api-factory.min.js"></script>
- Use the factory
facebookFactory
facebookFactory.getPostsFromPageById({
page:"<PAGE_ID>",
limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
until:"<UNTIL>", // (optional)
since:"<SINCE>", // (optional)
__previous:"<PREVIOUS>", // (optional)
__paging_token:"<PAGING_TOKEN>", // (optional)
access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
facebookFactory.getPhotosFromPageById({
page:"<PAGE>", // ID or name
limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
before:"<BEFORE>", // (optional)
after:"<AFTER>", // (optional)
access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
facebookFactory.getVideosFromPageById({
page:"<PAGE_ID>",
limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
before:"<BEFORE>", // (optional)
after:"<AFTER>", // (optional)
access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
facebookFactory.getEventsFromPageById({
page:"<PAGE_ID>",
limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
before:"<BEFORE>", // (optional)
after:"<AFTER>", // (optional)
access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
facebookFactory.getPageById({
page:"<PAGE_ID>",
access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
- docs: https://developers.facebook.com/docs/graph-api
- graph explorer: https://developers.facebook.com/tools/explorer/
bandsintown - dailymotion - facebook - flickr - footballdata - github - openweathermap - tumblr - vimeo - wikipedia - youtube
MIT