[REQUEST] ~ Autodoc or Full API
BD103 opened this issue ยท comments
Is your feature request related to a problem? Please describe.
I'm (as you probably know) heading the Python version of this project. The docs show the Nextra tutorial and README.md only shows a minimal amount of features.
Describe the solution you'd like
Please update the docs or add autodoc so that I can support all of the features.
Additional context
I'm not very good with Nodejs, so that's why I can't just read the source. Sorry!
@BD103 I'm working on writing up a collection of markdown files as documentation while Nextra is broken. I'll hopefully get it done sometime soon. In the meantime I can answer any questions you have?
Yes, how exactly do you get the data from Replit? Do you use HTTP requests or GraphQL? If so, how do you grab the data with GraphQL? I've never used it before, and can't read the JS well enough to figure it out. @rayhanadev
@BD103 I use HTTP Post requests to gather data. You can use the requests
module and json
module with following:
import json
import requests
url = "https://staging.replit.com"
headers = {
'X-Requested-With': 'anythingoesherelol',
'Referrer': 'https://staging.replit.com/'
}
body = {
# This is the GraphQL Query
'query': """
query User($username: String!) {
userByUsername(username: $username) {
karma
}
}
""",
# These are the GraphQL Variables
"variables": json.dumps({
"username": self.res['username'],
})
}
# This is the response
res = json.loads(requests.post(url, data=body,headers=headers).text)
print(res)
Why staging.replit.com
?
Two reasons
A. Overloading https://replit.com/graphql
affects the main site which is not good (I accidentally did it once, Cloudflare blocked all requests, things went bad for everyone)
B. Staging is technically meant for this sort of thing semantically speaking
@BD103 https://github.com/ReplAPI-it/API-Documentation I'll be writing the queries up here.
Closing since resolved.