FB Auto Post
Post or Schedule Random Posts for Facebook Page.
Author: Rainty Yek
License: Apache v2
Installing fb-auto-post
npm install fb-auto-post
import AutoPost from 'fb-auto-post';
var AutoPost = require('fb-auto-post');
Library usage
This library can be used to publish post and schedule posts to publish randomly or sequentially to FB pages
AutoPost.initialize({
app_id: "XXXXXXXXXXX",
app_secret: "XXXXXXXXXXX",
user_access_token: "XXXXXXXXXXX",
fb_api_url: 'graph.facebook.com',
datasource_src: 'data/autopost-data.json',
}).then((obj) => {
obj.publishPost('Hi everyone!', 'feed');
obj.publishPost('Here\'s my github profile!', 'link', 'https://github.com/raintyyek');
obj.publishPost('This is my github profile picture!', 'photo', null, 'https://avatars.githubusercontent.com/u/93080136?v=4');
obj.randomPosts('sample.json', true, 0, '* * * * *');
obj.randomPosts('sample.json', true, 0, '*/2 * * * *');
});
JSON format for .randomPosts
[
{
"message": "Hi everyone!",
"type": "feed"
},
{
"message": "Here's my github profile!",
"type": "link",
"link": "https://github.com/raintyyek"
},
{
"message": "This is my github profile picture!",
"type": "photo",
"photo": "https://avatars.githubusercontent.com/u/93080136?v=4"
}
]
message - Message Content of Post
type - feed / link / photo
link - Link to publish (Required when type is link)
photo - Photo URL to publish (Required when type is photo)
Refer to src/sample.json
License
This project is licensed under the Apache License, Version 2.0 (the "License"). For more details, see the LICENSE file.
Back to top