muharamdani / poe Goto Github PK
View Code? Open in Web Editor NEW[Reverse engineered API for Quora Poe]
License: Apache License 2.0
[Reverse engineered API for Quora Poe]
License: Apache License 2.0
This would provide certainty for developers who want to use the software in their projects. I personally use Apache-2.0 for all my projects. MIT, BSD-3-Clause, or GPL-3 are other common choices. Here's a table of their tradeoffs: https://choosealicense.com/appendix/
D:\Ai\Poe\poe> node ./dist/client_auto.js
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at new ChatBot (file:///D:/Ai/Poe/poe/dist/index.js:26:28)
at file:///D:/Ai/Poe/poe/dist/client_auto.js:2:13
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v18.16.0
The following is a new email address, and I have implemented it, it can be used directly, but POE will now return
{"data":null,"errors":[{"message":"Server Error"}],"extensions":{"is_final":true}}
I have never solved this.
import fetch from "cross-fetch";
import {readFileSync, writeFile} from "fs";
const createNewEmail = async () => {
const name = "poe" + Date.parse(new Date().toString()) + Math.random();
const response = await fetch(`https://maildrop.cc/page-data/inbox/page-data.json?mailbox=` + name);
const response_json = await response.json();
let credentials = JSON.parse(readFileSync("config.json", "utf8"));
if (!credentials) {
credentials = {}
}
credentials.email = name + "@maildrop.cc";
writeFile("config.json", JSON.stringify(credentials), function (err) {
if (err) {
console.log(err);
}
});
return {
email: credentials.email,
sid_token: name
}
}
const getEmailList = async (email) => {
let request = {
operationName: 'GetInbox',
query: "query GetInbox($mailbox: String!) {\n ping(message: \"Test\")\n inbox(mailbox: $mailbox) {\n id\n subject\n date\n headerfrom\n __typename\n }\n altinbox(mailbox: $mailbox)\n}\n",
variables: {
mailbox: email,
},
}
const response = await fetch(`https://api.maildrop.cc/graphql`, {
method: 'POST',
headers: {'Content-Type': 'application/json',},
body: JSON.stringify(request)
});
console.log("email=" + email)
const response_json = await response.json();
return {
list: response_json.data.inbox,
}
}
const getLatestEmail = async (sid_token) => {
let emailList = await getEmailList(sid_token);
let emailListLength = emailList.list.length;
if (emailListLength == 0) {
for (let i = 0; i < 30; i++) {
await new Promise(r => setTimeout(r, 1000));
emailList = await getEmailList(sid_token);
emailListLength = emailList.list.length;
console.log("emailListLength = " + emailListLength);
if (emailListLength > 0) {
break;
}
}
}
return emailList.list[0].id;
}
const getCodeId = async (name, id) => {
console.log("name", name, "id", id)
let request = {
operationName: 'GetMessage',
query: "query GetMessage($mailbox: String!, $id: String!) {message(mailbox: $mailbox, id: $id) {html\n}}",
variables: {
mailbox: name,
id: id
},
}
const response = await fetch(`https://api.maildrop.cc/graphql`, {
method: 'POST',
headers: {'Content-Type': 'application/json',},
body: JSON.stringify(request)
});
const response_json = await response.json();
return response_json.data.message.html
}
const getPoeOTPCode = async (email_name) => {
const emailDataId = await getLatestEmail(email_name)
let codeHtml = await getCodeId(email_name, emailDataId)
codeHtml = codeHtml.replace("\r\n", "")
let patt = new RegExp(/>\d{6}</g)
let arr = codeHtml.match(patt);
let code = arr[0].substring(1, 7)
console.log("emailData", code);
console.log("OTP CODE: " + code);
return code;
}
export {
createNewEmail,
getLatestEmail,
getPoeOTPCode
}
> [email protected] cli
> node ./dist/cli.js
โ Select ยป Semi-Auto [Use you own email/phone number]
...\poe\node_modules\cross-fetch\node_modules\node-fetch\lib\index.js:273
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
^
FetchError: invalid json response body at https://poe.com/api/gql_POST reason: Unexpected token < in JSON at position 0
at D:\AI\poe\node_modules\cross-fetch\node_modules\node-fetch\lib\index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChatBot.makeRequest (file:///D:/AI/poe/dist/index.js:114:16)
at async ChatBot.subscribe (file:///D:/AI/poe/dist/index.js:106:9)
at async ChatBot.startCli (file:///D:/AI/poe/dist/index.js:433:13)
at async file:///D:/AI/poe/dist/cli.js:3:1 {
type: 'invalid-json'
}
Node.js v18.17.1
What's the best way to get a ui running for this on mobile? Honestly Poe didn't have an exceptional UI so just something equal to it at a minimum.
Ideally i would want one to run locally on my burner. "Off the grid" is still a dream ya know
Okay, so I have tested manually if the https://github.com/cemalgnlts/Mailjs would work as a new service for email.
Doing the steps by hand, works just fine, and I even initialized the changes on the project at the mail file.
The problem is: The mutation to try and send the verification code is not working and i coulddnt get it to work at all.
If anyone can help me get it to work, I can manage to update the mail config to the auto email login and renew function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.