angular-facebook-api-factory

0.5.0 • Public • Published

angular-facebook-api-factory is an angularjs module with a facebook api factory.

Author: Jonathan Hornung (JohnnyTheTank)

Usage

  1. Install via either bower, npm or downloaded files:
    1. bower install --save angular-facebook-api-factory
    2. npm install --save angular-facebook-api-factory
    3. download angular-facebook-api-factory.zip
  2. Add jtt_facebook to your application's module dependencies.
  3. Include dependencies in your HTML.
    1. When using bower:
    <script src="bower_components/angular-facebook-api-factory/src/angular-facebook-api-factory.min.js"></script>
    1. When using npm:
    <script src="node_modules/angular-facebook-api-factory/src/angular-facebook-api-factory.min.js"></script>
    1. when using downloaded files
    <script src="angular-facebook-api-factory.min.js"></script>
  4. Use the factory facebookFactory

factory methods

getPosts

facebookFactory.getPostsFromPageById({
    pageId:"<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
});

getPhotos

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
});

getVideos

facebookFactory.getVideosFromPageById({
    pageId:"<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
});

getEvents

facebookFactory.getEventsFromPageById({
    pageId:"<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
});

getPage

facebookFactory.getPageById({
    pageId:"<PAGE_ID>",
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

Facebook Graph JSON API

License

MIT

Package Sidebar

Install

npm i angular-facebook-api-factory

Weekly Downloads

1

Version

0.5.0

License

MIT

Last publish

Collaborators

  • johnnythetank