Code Monkey home page Code Monkey logo

get-contact.js's Introduction

This api unofficial from GetContact

npm

get-contact.js

A GetContact API gclient that connects through the GetContact Web browser app

It uses Puppeteer to run a real instance of GetContact Web to avoid getting blocked.

NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. GetContact does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.

Quick Links

Installation on no-gui systems

For puppeteer to work, you need to install the following dependencies with the apt-get command (remember to apt-get update before you install).

sudo apt install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Installation

The module is now available on npm! npm i get-contact.js

Please note that Node v12+ is required.

Example usage

const { GClient } = require("get-contact.js");

const gclient = new GClient();

gclient.on("qr", (qr) => {
  // Generate and scan this code with your phone
  console.log("QR RECEIVED", qr);
});

gclient.on("ready", () => {
  console.log("Client is ready!");
});

gclient.initialize();

Take a look at example.js for another example with more use cases.

Reference

https://github.com/pedroslopez/whatsapp-web.js

get-contact.js's People

Contributors

ilhamridho04 avatar

Stargazers

CBNET avatar  avatar jarupong pajakgo avatar

Watchers

 avatar

get-contact.js's Issues

problem

hi, i have 2 problem, please help me

node example.js
/home/cyberman/test/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241
reject(new Error([
^

Error: Failed to launch the browser process!
[428814:428814:1102/115713.957128:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[428814:428814:1102/115713.957158:ERROR:env.cc(225)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/home/cyberman/test/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
at ChildProcess.<anonymous> (/home/cyberman/test/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:232:79)
at ChildProcess.emit (node:events:526:35)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)

Node.js v18.17.1

================================================

npm i getcontact-web.js

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/getcontact-web.js - Not found
npm ERR! 404
npm ERR! 404 'getcontact-web.js@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: /home/cyberman/.npm/_logs/2023-11-02T11_58_56_984Z-debug-0.log

Session Auth

Is there a function to save and restore sessions so that users won't have to scan the QR code every time the project is restarted?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.