Discuss Scratch

WooHooBoy
Scratcher
1000+ posts

Scratch APIs

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?

considered harmful
BookOwl
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

BookOwl wrote:

BookOwl wrote:

My life is turing complete.
Nobody seems to get my joke.
I do :p
Yay!

who needs signatures
Jonathan50
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

https://api-staging.scratch.mit.edu/proxy/users/kaj/activity/count has 403 unread messages
That's the first thing I tried
DANGIT SOMEONE ELSE ALREADY DID IT SMGLKJ$JGLJSF

https://api.scratch.mit.edu/users/thisandagain/following thanks thisandagain
I did that before @comp09

Not yet a Knight of the Mu Calculus.
Jonathan50
Scratcher
1000+ posts

Scratch APIs

Oh BTW to find APIs you can use something like Fiddler etc. it works great but for now only on the front page for the new ones…

Not yet a Knight of the Mu Calculus.
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?

help!

considered harmful
technoboy10
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?

trans rights are human rights
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r

Last edited by WooHooBoy (Oct. 28, 2015 00:18:31)


considered harmful
technoboy10
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r
Try using https instead of http.

trans rights are human rights
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r
Try using https instead of http.
Same thing.

considered harmful
thisandagain
Forum Moderator
500+ posts

Scratch APIs

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug

CORS is enabled (allow “*”) on the new API. Just let me know if you see anything weird / broken. I'll try to get patches out for you folks quickly.
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

thisandagain wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug

CORS is enabled (allow “*”) on the new API. Just let me know if you see anything weird / broken. I'll try to get patches out for you folks quickly.
Hm, still doesn't work for me. Oh yeah, I don't think qwest works with some things. Time to go find something else to use!

considered harmful
thisandagain
Forum Moderator
500+ posts

Scratch APIs

WooHooBoy wrote:

Hm, still doesn't work. I'm using qwest, does that make a difference?

Can you post your code in addition to the error? Here is a working example:
http://codepen.io/anon/pen/wKjgEp?editors=001
Jonathan50
Scratcher
1000+ posts

Scratch APIs

I might rewrite scribblemod.tk with PHP or Python/Django or C/C++ and take advantage of these…

Not yet a Knight of the Mu Calculus.
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

thisandagain wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r
Try using https instead of http.
Same thing.

Can you post your code in addition to the error?
Sure.
qwest.get('https://crossorigin.me/https://api.scratch.mit.edu/users/WooHooBoy/following?limit=5')
    .then(function(xhr, response) {
        // things
    });

Probably a problem with qwest…

considered harmful
ChocolatePi
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

thisandagain wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r
Try using https instead of http.
Same thing.

Can you post your code in addition to the error?
Sure.
qwest.get('https://crossorigin.me/https://api.scratch.mit.edu/users/WooHooBoy/following?limit=5')
    .then(function(xhr, response) {
        // things
    });

Probably a problem with qwest…
why not just use the standard xhr?
Jonathan50
Scratcher
1000+ posts

Scratch APIs

WooHooBoy wrote:

Probably a problem with qwest…
If you got cross-origin request errors that's unlikely…

Not yet a Knight of the Mu Calculus.
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

ChocolatePi wrote:

WooHooBoy wrote:

thisandagain wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug
Hm, still doesn't work. I'm using qwest, does that make a difference?
No, it shouldn't. Can you post the actual error you're getting?
http://prntscr.com/8w3z5r
Try using https instead of http.
Same thing.

Can you post your code in addition to the error?
Sure.
qwest.get('https://crossorigin.me/https://api.scratch.mit.edu/users/WooHooBoy/following?limit=5')
    .then(function(xhr, response) {
        // things
    });

Probably a problem with qwest…
why not just use the standard xhr?
Because I was lazy

I'll try standard.
Hmmm, seems to work fine. Stupid qwest.

considered harmful
thisandagain
Forum Moderator
500+ posts

Scratch APIs

WooHooBoy wrote:

Sure.
qwest.get('https://crossorigin.me/https://api.scratch.mit.edu/users/WooHooBoy/following?limit=5')
    .then(function(xhr, response) {
        // things
    });

Probably a problem with qwest…

Huh. It seems like the qwest library is appending some cache-control headers that we don't support. FWIW we use `xhr`:
https://www.npmjs.com/package/xhr

Also, you can drop the "https://crossorigin.me/“ part as we support requests from ”*".
WooHooBoy
Scratcher
1000+ posts

Scratch APIs

thisandagain wrote:

WooHooBoy wrote:

Sure.
qwest.get('https://crossorigin.me/https://api.scratch.mit.edu/users/WooHooBoy/following?limit=5')
    .then(function(xhr, response) {
        // things
    });

Probably a problem with qwest…

Huh. It seems like the qwest library is appending some cache-control headers that we don't support. FWIW we use `xhr`:
https://www.npmjs.com/package/xhr

Also, you can drop the "https://crossorigin.me/“ part as we support requests from ”*".
I'll check that out, looks pretty good.
I'll probably just create my own for this purpose.

considered harmful
MegaApuTurkUltra
Scratcher
1000+ posts

Scratch APIs

thisandagain wrote:

technoboy10 wrote:

WooHooBoy wrote:

Welp, I know nothing about CORS…
Anyone mind giving a little explanation on using the API in a webapp? (I'm really dumb )
If CORS isn't enabled on the API server, just append
https://crossorigin.me/
to the front of any URL, and it should work automagically. shameless plug

CORS is enabled (allow “*”) on the new API. Just let me know if you see anything weird / broken. I'll try to get patches out for you folks quickly.
Will we get the ability to read messages?

$(".box-head")[0].textContent = "committing AT crimes since $whenever"

Powered by DjangoBB