Discuss Scratch

roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

So I was learning how to use requests, and I sorta accidentally coded this whole thing!
Ok, here's the code:
import requests
projId = input("Project id?\n>")
response = requests.get(str("https://scratchdb.lefty.one/v3/project/info/" + projId))
projectInfo = response.json()
print("\nProject Title:" , projectInfo["title"])
username = projectInfo["username"] #Saved so we can get user information (coming soon) and get ocular data.
print("Author's Username:" , username)
print("\nInstructions:" , projectInfo["instructions"])
print("Notes and Creds:" , projectInfo["description"])
print("\nComments Allowed:" , str(projectInfo["comments_allowed"]))
remix = projectInfo["remix"]
print("\nRemix parent:" , str(remix["parent"]))
print("Remix root:" , str(remix["root"]))

I know its long, but I don't have github, so if anyone has any ideas to host this, let me know!

INSTRUCTIONS:

When it asks for the ID, insert the number in the project link.
If it says something about requests not being a module, run
pip install requests
in your terminal.

So yeah! Feel free to improve my code, and use this in your own stuff! Just remember to credit me!
UPDATE: Switched over to ScratchDB

Last edited by roketH77 (June 7, 2021 16:54:26)

roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

while True:
    print("bump")

Last edited by roketH77 (May 7, 2021 06:53:45)

Chiroyce
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

What does this do?

roketH77 wrote:

While True:
   Print(bump)
(1) while is not capital
(2) print is not capital
(3) (bump) will not work as it is an undeclared variable, use
while True:
    print("bump")
(4) You forgot to close the [/code] tag
roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

Chiroyce wrote:

What does this do?

roketH77 wrote:

While True:
   Print(bump)
(1) while is not capital
(2) print is not capital
(3) (bump) will not work as it is an undeclared variable, use
while True:
    print("bump")
(4) You forgot to close the [/code] tag
Bro chill I wanted to make a joke
roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

Bump
roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

bump
roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

Bump????
roketH77
Scratcher
1000+ posts

☆ Scratch Project Info Browser ☆ (WRITTEN IN PYTHON)

Bumpety bumpety bump

Powered by DjangoBB