Discuss Scratch

MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

How would I obtain the URL of a users profile picture, and display it.

MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

    fetch('https://scratchdb.lefty.one/v3/user/info/' + input)
        .then(res => res.json())
        .then(data => {
            const status = data.bio;
            $('#status').innerText = status;
        });
This is supposed to get the users bio, why doesn't it.
I also tried it with status, which didn't work

MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage


MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

Changes in 0.2.2

- Bug fixes
- The tailwind styles are now a minified css file generated by the tailwindcss command line utility instead of using the cdn (faster performance)

MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

What features would you like to see? Make suggestions @ https://github.com/JaydenDev/MyScratchPage/issues
(If your suggestion involves an API, please put a working fetch() function into the issue report so that the feature can be implemented more quickly

LegoManiac04
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

MagicCrayon9342 wrote:

How would I obtain the URL of a users profile picture, and display it.
Get the user ID from ScratchDB and then do
"https://uploads.scratch.mit.edu/get_image/user/“ + id + ”_60x60.png"

NFlex23
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

This is kind-of similar to Scratch Profiler.

Help improve the Advanced Topics (Really!)
Before you create a topic:
Always search for duplicates or other similar topics before making an umbrella topic, e.g., “The Mac Topic”.
  • Is it about something you are planning on making but haven't made yet? If so, please wait to post until you have created a working prototype. This is a key factor to keeping the ATs as clean as possible.
  • The ATs aren't technical support. It is perfectly valid to ask questions about things related to programming, but not issues with external websites, apps, or devices. Most sites have their own support system; try asking there!
  • Is it related to something you are making in Scratch? (This includes OSes and other Scratch projects) If so, please post in Collaboration, Show and Tell, or another similar forum.
  • Is your topic questionably “advanced”? Try browsing the other forums to see if your topic fits better in one of those.
  • Issues with Scratch itself should be put in Bugs and Glitches.
Before you post: Is what you're posting likely to start an argument or derail the thread (e.g., browsers, operating systems)? If so, please re-think your post!





MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

NFlex23 wrote:

(#27)
This is kind-of similar to Scratch Profiler.
Yeah, just worse. Since I suck at UI design.

MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

  
fetch('https://my-ocular.jeffalo.net/api/user/' + input)
        .then(res => res.json())
        .then(data => {
            // grab "id" from the data
            const { id } = data;
            const img = "https://uploads.scratch.mit.edu/get_image/user/" + id + "_60x60.png";
            $('#pfp').attr('src', img);
        });
Doesn't work

Chiroyce
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

MagicCrayon9342 wrote:

Doesn't work
try doing this
const id = data.id;

Last edited by Chiroyce (March 27, 2022 15:57:53)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

Chiroyce wrote:

(#30)

MagicCrayon9342 wrote:

Doesn't work
try doing this
const id = data.id;
nope

kccuber
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

MagicCrayon9342 wrote:

  
fetch('https://my-ocular.jeffalo.net/api/user/' + input)
        .then(res => res.json())
        .then(data => {
            // grab "id" from the data
            const { id } = data;
            const img = "https://uploads.scratch.mit.edu/get_image/user/" + id + "_60x60.png";
            $('#pfp').attr('src', img);
        });
Doesn't work
that's probably copilot's fault if you let copilot write that

Last edited by kccuber (March 27, 2022 16:21:20)



Made using Nord Theme & Inkscape
MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

kccuber wrote:

(#32)

MagicCrayon9342 wrote:

  
fetch('https://my-ocular.jeffalo.net/api/user/' + input)
        .then(res => res.json())
        .then(data => {
            // grab "id" from the data
            const { id } = data;
            const img = "https://uploads.scratch.mit.edu/get_image/user/" + id + "_60x60.png";
            $('#pfp').attr('src', img);
        });
Doesn't work
that's probably copilot's fault if you let copilot write that
I tried myself and with copilot, fetch() is my weakness

Chiroyce
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

removed

Last edited by Chiroyce (March 27, 2022 16:25:48)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Chiroyce
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

try this, and check the console
fetch('https://my-ocular.jeffalo.net/api/user/' + input)
        .then(res => res.json())
        .then(data => {
            console.log(`Fetching ${input}'s my-ocular data...`);
            console.log(`Got ${input}'s data - ${data}`);
            let id = data.id;
            const img = "https://uploads.scratch.mit.edu/get_image/user/" + id + "_60x60.png";
            $('#pfp').attr('src', img);
        });







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage


Chiroyce
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

MagicCrayon9342 wrote:

https://stackoverflow.com/questions/22665232/what-can-cause-chrome-to-give-an-neterr-failed-on-cached-content-against-a-ser

https://www.google.com/search?q=net%3A%3AERR_FAILED

can you try stepping through every line of code via the chrome debugger?

Last edited by Chiroyce (March 28, 2022 02:39:42)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
Chiroyce
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

this works for me (Firefox)
fetch('https://my-ocular.jeffalo.net/api/user/' + input)
        .then(res => res.json())
        .then(data => {
            console.log(`Fetching ${input}'s my-ocular data...`);
            console.log(data);
            console.log(data._id);
        });








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
mbrick2
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

It says enter text here not enter username here








My Forums
ATs
Collabaration
My collabs
AIPoint
AspectOS
CoreOS
OddyseyOS
Cops and Robbers
#BringBackManagerRights
#ReturnRightsToManagers
#WeAreForManagerRights
#LetsRemindAboutMangers
#WeAreMangers
#MangersMustManage

The road to 1000 posts!
0 ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ 1000
80% complete

Banner Made By @Abcde26



Card Made By @Polygon
MagicCrayon9342
Scratcher
1000+ posts

[v0.4.1] [v0.5.0 coming soon] [NEVER! Porting to NextJS (too hard)] MyScratchPage

Can someone inspect the source as find out why https://jaydendev.github.io/MyScratchPage?user=MagicCrayon9342 doesn't work

Powered by DjangoBB