facebook-simple-api

1.0.1 • Public • Published

Facebook Simple API

Wrapped from Facebook's Graph API

Example

Install

> npm install facebook-simple-api

Example

// Import method
const {
  getUserInfo,
  getFriendList,
  getFriendRequest,
  getLatestFeed,
  getLastActiveUser,
  postLikeStatus 
= require('facebook-simple-api')
 
// Initializing a variable
const ACCESS_TOKEN = 'EAAAAZAw4FxQIBAPXXX'
const ID_USER = '4'
const ID_STATUS = '100000502834385_3933036873389702'
const LIMIT_FETCH = '5'
 
// Method
  • Get User Information
getUserInfo(ID_USER, ACCESS_TOKEN)
.then(response => {
  console.log(response)
})
  • Get User Friend List
getFriendList(ACCESS_TOKEN)
.then(response => {
  console.log(response)
})
  • Get All Friend Request
getFriendRequest(ACCESS_TOKEN)
.then(response => {
  console.log(response)
})
  • Get Your Latest Feed
getLatestFeed(LIMIT_FETCH, ACCESS_TOKEN)
.then(response => {
  console.log(response)
})
  • Get Last Activity User
getLastActiveUser(ID_USER, ACCESS_TOKEN)
.then(response => {
  console.log(response)
})
  • Like Status
postLikeStatus(ID_STATUS, ACCESS_TOKEN)
.then(response => {
  console.log(response)
})

/facebook-simple-api/

    Package Sidebar

    Install

    npm i facebook-simple-api

    Weekly Downloads

    3

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    66 kB

    Total Files

    14

    Last publish

    Collaborators

    • cdw1p