Skip to content

Commit cd28247

Browse files
HaoHao
Hao
authored and
Hao
committedJun 10, 2023
Modify example and README
1 parent 7785ab6 commit cd28247

File tree

4 files changed

+51
-12
lines changed

4 files changed

+51
-12
lines changed
 

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ This is a self hostable, reverse-engineered API for Quora's Poe that allows acce
77
### Requirements
88
To use this API, you will need to have the following cookies:
99

10-
2. Quora-Formkey: This is obtained by logging in to Quora.com, viewing the page source, and finding the "formkey" dictionary key (Normally line 14). Use its value in the Quora-Formkey field.
11-
3. Cookie: 'm-b=xxxx' - This is the value of the cookie with the key m-b, which is present in the list of cookies used on Quora.com (not poe.com), you can simply inspect cookies in Chrome to get it.
10+
1. Quora-Formkey: This is obtained by logging in to Quora.com, viewing the page source, and finding the "formkey" dictionary key (Normally line 14). Use its value in the Quora-Formkey field.
11+
2. Cookie: 'm-b=xxxx' - This is the value of the cookie with the key m-b, which is present in the list of cookies used on Quora.com (not poe.com), you can simply inspect cookies in Chrome (F12-Application-cookie) to get it.
1212
### Setup
1313
<details>
1414
<summary>Simple Setup</summary>
@@ -30,7 +30,7 @@ pip install -r requirements.txt
3030
- Run the API
3131

3232
```bash
33-
uvicorn api:app --reload
33+
uvicorn api:app --host 0.0.0.0 --port 8000 --reload
3434
```
3535

3636
- Verify that the API is running by running:
@@ -50,7 +50,7 @@ Access the url given, in your browser to confirm it works. This is your bot serv
5050

5151
### Example
5252
```bash
53-
curl http://127.0.0.1/chat/capybara -d '{"Cookie: m-b=xxxx" , "formkey: xxxxx", "message":"What is the meaning of life?"}'
53+
curl http://127.0.0.1/chat/a2 -d '{"bot:a2" , "Cookie:m-b=xxxx" , "formkey:xxxxx", "message":"What is the meaning of life?"}'
5454
```
5555
Response:
5656
```json

‎example.py

-8
This file was deleted.

‎example/Circuitpython.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import wifi
2+
import socketpool
3+
import adafruit_requests
4+
5+
pool = socketpool.SocketPool(wifi.radio)
6+
requests = adafruit_requests.Session(pool)
7+
8+
'''
9+
Quora-Formkey: This is obtained by logging in to Quora.com, viewing the page source, and finding the "formkey" dictionary key (Normally line 14). Use its value in the Quora-Formkey field.
10+
Cookie: 'm-b=xxxx' - This is the value of the cookie with the key m-b, which is present in the list of cookies used on Quora.com (not poe.com), you can simply inspect cookies in Chrome (F12-Application-cookie) to get it.
11+
'''
12+
cookie = "m-b="
13+
formkey = ""
14+
url = "http://192.168.50.100:8000/chat/a2"
15+
16+
msg = "Hi"
17+
18+
data = {
19+
"bot":"a2",
20+
"cookie":cookie,
21+
"formkey":formkey,
22+
"message":msg
23+
}
24+
25+
response = requests.post(url, json=data)
26+
print(response.json())

‎example/python3.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import requests
2+
3+
'''
4+
Quora-Formkey: This is obtained by logging in to Quora.com, viewing the page source, and finding the "formkey" dictionary key (Normally line 14). Use its value in the Quora-Formkey field.
5+
Cookie: 'm-b=xxxx' - This is the value of the cookie with the key m-b, which is present in the list of cookies used on Quora.com (not poe.com), you can simply inspect cookies in Chrome (F12-Application-cookie) to get it.
6+
'''
7+
cookie = "m-b="
8+
formkey = ""
9+
url = "http://localhost:8000/chat/a2"
10+
11+
msg = "Hi"
12+
13+
data = {
14+
"bot":"a2",
15+
"cookie":cookie,
16+
"formkey":formkey,
17+
"message":msg
18+
}
19+
20+
response = requests.post(url, json=data)
21+
print(response.json())

0 commit comments

Comments
 (0)
Please sign in to comment.