Skip to content

Repository files navigation

node-facebook

All Contributors

FOSSA Status shieldNPM VersionNPM DownloadsLicense

TravisCodecovCode styleCodeFactor

FOSSA Status large

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using npm or yarn:

$ npm install node-facebook
or
$ yarn add node-facebook

Follow node-facebook's wiki for more information.

Feature

This module have function same you use browser.

Usage

  • In first time, you should login with email and password:

  • When you logged in, use api.getState() to save cookie with this code:

constfs=require('fs');constFacebook=require('node-facebook');constme=newFacebook({email: 'your username/id',pass: 'your pass'});me.login().then((api)=>{fs.writeFileSync('state.json',JSON.stringify(api.getState()));});
  • Now, you can login with cookie with file state.json:
constme=newFacebook({state: JSON.parse(fs.readFileSync('state.json','utf8'))});

Example

kiat-bot is sample use node-facebook

Credits

node-facebook has been inspired by facebook-chat-api Thanks to Avery Morin for excellent prior art !

Contributors

Thanks goes to these wonderful people (emoji key):

Hongarc
Hongarc

📆👀⚠️💻
Avery Morin
Avery Morin

🤔
Oliver Cristian
Oliver Cristian

📢

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Facebook simulator web browser

Topics

Resources

Stars

10 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages