laluka / fb-fuzzy-link-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fb-fuzzy-link-bot

Welcome to fb-fuzzy-link-bot!

WebUI

This project is composed of three main components:

  1. fb-msg-listener.js // Puppeteer bot to poll for new messages with your facebook account
  2. fb-msg-server.js // A simple webUI with fuzzy-find (fusejs) to get links
  3. fb-conf.json // messengerURL (1), ThreadID (2 base64-decoded), basic auth credentials, listening port

Config from devtools

Setup

npm i puppeteer forever basic-auth
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
# Export your messenger.com cookies with Cookie-Editor (the format smoothly with puppeteer)
# https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
# Place the json in cookies.json

Example fb-conf.json

{
    "messengerUrl": "https://www.messenger.com/t/XXXXXXXXXXXXXXXX",
    "threadFbId": "XXXXXXXXXXXXXXXX",
    "port": 8000,
    "basicAuth": {
        "username": "dummy_user",
        "password": "dummy_pass"
    }, 
    "debug": false
}

Run

forever --watch fb-msg-server.js
node fb-msg-listener.js

What about docker ?

Yeah, sure :)

./build-and-run.sh

Contribute

Of course contributions are always welcome, feel free to fork, tweak, and submit a PR ! :)

About


Languages

Language:JavaScript 51.8%Language:HTML 39.3%Language:Shell 6.1%Language:Dockerfile 2.7%