Comments (9)
Hi @yodaheis @CarlosEduR @NewZeek @Mrjavaci @MuallimCh
I've implemented this feature in v 1.2.3 of sulla-hotfix.
It uses the event emitter to grab the qr code when it's ready as base64.
You can see it here:
https://github.com/smashah/sulla#capturing-qr-code
Let me know if this works for you! Thanks
from sulla.
I am interested in this topic. I will return when I find a solution.
from sulla.
Hi, to send qrcode to frontend import fs to auth.js and save qrcode to html file.
const fs = require('fs');
//After case 2:
qrImage = _a.sent();
fs.writeFile('qrcode.html', '<html><body><img src="https://api.qrserver.com/v1/create-qr-code/?data=' + encodeURIComponent(qrImage) + '"></body></html>', (err) => {
if (err) throw err;
console.log('QrCode saved to file.');
});
Boa sorte.
from sulla.
Hello, Daniel! How are you?
I'm really grateful about the project you've done. I appreciate it.I have a question: I got a freelancer job, and client would like to use this tool over browser, so I'd need to send QRCode to frontend.
Could you help me out on this issue?
in src/controllers/auth.ts
After const qrImage declaration, just create other const that coresponds to image itself, and show it to window.
Just my opinion.
from sulla.
It really works, I'm feeling a noob 'cause didn't think about this way.
Valeu, NewZeek.
But, as this 'create()' is an asynchronous function, I'd need to load it only when it has been already generated, and this function only finishes when QR Code from terminal was scanned. Do you have any simple idea to solve this?
from sulla.
The terminal and file QR are the same. When you read the html file in the browser, this terminal function automatically terminates. As sulla is a browser automation, it works as whatsapp web application and who informs that the qr has been read is the whatsapp app from smartphone.
In your application, create an ajax function that reads the qr file in time Interval e create a element tag < img /> when the server return the value.
Sorry my english
from sulla.
Ola pessoas,
What will be really cool is if we could take a snapshot, export a pdf and email it. I will give a shot at adding this feature.
from sulla.
does anyone has one sample?
from sulla.
When calling create()
method you can attach a callback for it
const fs = require('fs');
// Second create() parameter is the QR callback
sulla.create('session-marketing', (qrCode) => {
exportQR(qrCode, 'marketing-qr.png');
});
// Writes QR in specified path
function exportQR(qrCode, path) {
qrCode = qrCode.replace('data:image/png;base64,', '');
const imageBuffer = Buffer.from(qrCode, 'base64');
// Creates 'marketing-qr.png' file
fs.writeFileSync(path, imageBuffer);
}
from sulla.
Related Issues (20)
- How to manage and send message to diffusion list?
- Can't log in HOT 6
- Feature Request: Adding options for setting executablePath puppeteer option
- just ask HOT 1
- Sulla On Raspbian Not Working Correctly HOT 1
- subscribe - Unsubscribe - reolad Pls? HOT 1
- QR Code does not work! HOT 4
- Contacts Status (Stories images, not connection status) HOT 2
- get number connected HOT 4
- Stuck forever on ⠧ Authenticate to continue HOT 3
- profilePicFind Not working
- Verify phone is registered
- Banned HOT 4
- [Question] CRM integrations HOT 5
- Error: Evaluation failed: ReferenceError: webpackJsonp is not defined HOT 2
- How can I block the message from "status@broadcast"
- Authenticate to continue HOT 1
- Cannot establish connection
- can we download destructive images/videos?
- Not proceeding authentication
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sulla.