npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ibrahemvx2000/fca-unofficial

v1.3.33

Published

A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.

Downloads

8

Readme

@ibrahemvx2000/fca-unofficial

Unofficial Facebook Chat API

npm version npm downloads code style: prettier

This API allows you to automate chat functionalities on a user account by emulating the browser. It achieves this by making the exact same GET/POST requests as if accessing the website normally. However, please note that this API requires the credentials of a Facebook account and does not work with an auth token.

Disclaimer: We want to emphasize that we are not responsible if your account gets banned for engaging in spammy activities such as sending large numbers of messages to unknown individuals, rapidly sending messages, sending suspicious-looking URLs, or frequently logging in and out. Please be a responsible user and respect Facebook's policies.

Installation

If you wish to use @ibrahemvx2000/fca-unofficial, you can install it via NPM using the following command:

npm install @ibrahemvx2000/fca-unofficial

This command will download and install @ibrahemvx2000/fca-unofficial from the NPM repositories.

Testing Your Bots

If you wish to test your bots without creating another Facebook account, you can use Facebook Whitehat Accounts: https://www.facebook.com/login.php?next=https%3A%2F%2Fwww.facebook.com%2Fwhitehat%2Faccounts%2F

Example Usage

Here's an example of creating a simple echo bot using the API:

const login = require("@ibrahemvx2000/fca-unofficial");

// Create a simple echo bot
login({ email: "FB_EMAIL", password: "FB_PASSWORD" }, (err, api) => {
    if (err) return console.error(err);

    api.listenMqtt((err, message) => {
        api.sendMessage(message.body, message.threadID);
    });
});

Documentation

Main Functionality

Sending a Message

To send a message, you can use the api.sendMessage() function. Various types of messages can be sent, including regular messages, stickers, files/images, URLs, and emojis:

api.sendMessage(message, threadID[, callback][, messageid]);

FAQ

How do I run tests?

To run tests, create a test-config.json file similar to example-config.json and place it in the test directory. Then, run npm test from the root directory.

Why doesn't sendMessage always work when I'm logged in as a page?

Pages cannot initiate conversations with users directly to prevent spamming.

What do I do when login doesn't work?

First, check if you can log in to Facebook using the website. If login approvals are enabled, make sure you are logging in correctly. Refer to the login documentation for handling login approvals.

How can I avoid logging in every time? Can I log into a previous session?

You can cache relevant data to bypass login using api.getAppState(), which returns an object that you can save and pass into login as {appState: mySavedAppState} instead of the credentials object.

Do you support sending messages as a page?

Yes, you can set the pageID option on login. Refer to the documentation for an example.

I'm getting some crazy weird syntax error like SyntaxError: Unexpected token [!!!

Please try updating your version of Node.js before submitting an issue of this nature, as newer language features might be used.

I don't want all of these logging messages!

You can use api.setOptions to silence the logging. For example, api.setOptions({logLevel: "silent"}).