Socket
Socket
Sign inDemoInstall

facebook-api-video-upload

Package Overview
Dependencies
56
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    facebook-api-video-upload

A handy function to upload video in chunk on the facebook graph.


Version published
Weekly downloads
407
increased by9.41%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

facebook-api-video-upload

Upload a video in chunk on the facebook api. more info

Install

$ npm i facebook-api-video-upload --save

Tested on OS X and Linux.

Usage

const fs = require('fs');
const fbUpload = require('facebook-api-video-upload');

const args = {
  token: "YOURTOKEN", // with the permission to upload
  id: "YOURID", //The id represent {page_id || user_id || event_id || group_id}
  stream: fs.createReadStream('./fixture.mp4'), //path to the video,
  title: "my video",
  description: "my description",
  thumb: {
    value: fs.createReadStream('./fixture.jpg'),
    options: {
      filename: 'fixture.jpg',
      contentType: 'image/jpg'
    }
  }
  // if you want the default thumb from the video just remove the field
  // you can add any extra fields from the api https://developers.facebook.com/docs/graph-api/reference/page/videos/#Creating
  // all keys except token, id, stream are passed to the final request
};

fbUpload(args).then((res) => {
  console.log('res: ', res);
  //res:  { success: true, video_id: '1838312909759132' }
}).catch((e) => {
  console.error(e);
});```

## License
MIT © [MrdotB](https://github.com/MRdotB)

Keywords

FAQs

Last updated on 08 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc