
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
fb-auto-post
Advanced tools
Post or Schedule Random Posts for Facebook Page.
Author: Rainty Yek
License: Apache v2
npm install fb-auto-post
// Using import
import AutoPost from 'fb-auto-post';
// Using require()
var AutoPost = require('fb-auto-post');
This library can be used to publish post and schedule posts to publish randomly or sequentially to FB pages
AutoPost.initialize({
app_id: "XXXXXXXXXXX", // (Required) Generate from From Your Facebook Developer App
app_secret: "XXXXXXXXXXX", // (Required) Generate from From Your Facebook Developer App
user_access_token: "XXXXXXXXXXX", // (Required) Generate from Facebook Developer Platform Tool, Permissions Needed: public_profile, pages_manage_posts, pages_show_list, pages_read_engagement
fb_api_url: 'graph.facebook.com', // (Optional) Default: graph.facebook.com
datasource_src: 'data/autopost-data.json', // (Optional) Default: data/autopost-data.json
}).then((obj) => {
/**
* Publish Post Function
* Template: obj.publishPost(message, type, link, photo, callback)
* @param {string} message Message Content for the post
* @param {string} type Post Type (Supported: feed, photo, link)
* @param {string} link Link to publish (Optional)
* @param {string} photo Photo URL to publish (Optional)
* @param {function(?Error, string)} callback A callback function
* */
// Post Message
obj.publishPost('Hi everyone!', 'feed');
// Post Link
obj.publishPost('Here\'s my github profile!', 'link', 'https://github.com/raintyyek');
// Post Photo
obj.publishPost('This is my github profile picture!', 'photo', null, 'https://avatars.githubusercontent.com/u/93080136?v=4');
/**
* Schedule Random Posts
* Template: obj.randomPosts(json_path, random, loop_times, schedule, timezone)
* @param {string} json_path File path of JSON Random Posts
* @param {boolean} random (Optional) (Default: false) Set to True to enable Randomly publish post, else it will publish by ordering in array
* @param {integer} loop_times (Optional) (Default: 0) Number of times to loop the array, Set to 0 for infinite
* @param {string} schedule Cron Job Schedule (Optional) (Default: '0 0 * * * *') - Follows format of node-cron (https://www.npmjs.com/package/node-cron)
* @param {string} timezone Cron Job Timezone (Optional) (Default: Asia/Kuala_Lumpur) - Follows format of node-cron (https://www.npmjs.com/package/node-cron)
* */
obj.randomPosts('sample.json', true, 0, '* * * * *'); // Every Minute Publish 1 Post
obj.randomPosts('sample.json', true, 0, '*/2 * * * *'); // Every 2 Minutes Publish 1 Post
// ...
});
[
{
"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
This project is licensed under the Apache License, Version 2.0 (the "License"). For more details, see the LICENSE file.
FAQs
Post or Schedule Random Posts for Facebook Page
The npm package fb-auto-post receives a total of 8 weekly downloads. As such, fb-auto-post popularity was classified as not popular.
We found that fb-auto-post demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.