I'm not sure if it's been done, but I'd like an api that puts a random project of my Favorite Projects. Or maybe the most recent one, I don't know
Offline
That's not been done because I can't think of a way to get a random project image to have a matching link! Can anyone think of a way? I'd prefer not to use MySQL...
LS97, so how would your "fake directory" suggestion display this?
http://www.blocks.scratchr.org/API.php?action=project&user=sparks&type=newest&return=image
?
Last edited by sparks (2011-08-27 15:58:17)
Offline
sparks wrote:
That's not been done because I can't think of a way to get a random project image to have a matching link! Can anyone think of a way? I'd prefer not to use MySQL...
LS97, so how would your "fake directory" suggestion display this?
http://www.blocks.scratchr.org/API.php?action=project&user=sparks&type=newest&return=image
?
http://www.blocks.scratchr.org/API/project/newest/image/sparks or something!
Offline
LS97 wrote:
sparks wrote:
That's not been done because I can't think of a way to get a random project image to have a matching link! Can anyone think of a way? I'd prefer not to use MySQL...
LS97, so how would your "fake directory" suggestion display this?
http://www.blocks.scratchr.org/API.php?action=project&user=sparks&type=newest&return=image
?http://www.blocks.scratchr.org/API/project/newest/image/sparks or something!
i can do that with .htaccess
its used on scratch wiki
Last edited by comp500 (2011-09-03 07:03:34)
Offline
comp500 wrote:
LS97 wrote:
sparks wrote:
That's not been done because I can't think of a way to get a random project image to have a matching link! Can anyone think of a way? I'd prefer not to use MySQL...
LS97, so how would your "fake directory" suggestion display this?
http://www.blocks.scratchr.org/API.php?action=project&user=sparks&type=newest&return=image
?http://www.blocks.scratchr.org/API/project/newest/image/sparks or something!
i can do that with .htaccess
its used on scratch wiki
That's my whole point -_-
Offline
LS97 wrote:
comp500 wrote:
LS97 wrote:
http://www.blocks.scratchr.org/API/project/newest/image/sparks or something!i can do that with .htaccess
its used on scratch wikiThat's my whole point -_-
Offline
Offline
thisisntme wrote:
You need to replace IMAGELINK1 and IMAGELINK2 with actual url links to images, thisisnotme
Offline
ProgrammingFreak wrote:
I did the online/offline detector:
I'm glad that you're interested in using the Scratch API. We will have quite the adventure. But maybe you're new at all this PHP stuff and need a little guidence on what to do.
Well you've come to the right place.
1 Offline/Online Detector
With this device you will be able to tell if a user is online or not. This is really simple. In a image tag, instead of linking to an image, you link to the api:Code:
[url]http://blocks.scratchr.org/API.php[/url]But thats not all. You add a
Code:
?user=USERNAME&action=onlineStatusTo the end of that url. With this code, you can have an image of a green/gray dot to tell if you are online or not.
But wait, there is still more!
Maybe you think the image you have is boring, and you want something different. Well, you are not alone.
All you have to do is add aCode:
&type=to the end of the url and your possibilies extend even further!
Here are your options:
A square button:Code:
&type=squareText:
Code:
&type=textYou can even do your own image! To do so, add:
Code:
&online=URLOFIMAGEFORONLINE&offline=URLOFIMAGEFOROFFLINEYou are probably thinking, "Wow. Thats so long I'll never understand it!". But I can help you with it!
Lemme break it down to you:
First, we add the username:Code:
user=USERNAMEThen we add the action:
Code:
&action=onlineStatusRemember, we've done this before. So don't sweat it!
Next we add the image to show when the user is online:Code:
&online=URLOFIMAGEFORONLINEFinally we add the image to show when the user is offline:
Code:
&offline=URLOFIMAGEFOROFFLINE(remember to fill in the actual urls for this to work)
And you're done! Enjoy your offline/online detector!
Offline
kayybee wrote:
Just wondering, is there a way to get the love its/views/other info for a specific project?
Offline
sparks wrote:
That's not been done because I can't think of a way to get a random project image to have a matching link! Can anyone think of a way? I'd prefer not to use MySQL...
LS97, so how would your "fake directory" suggestion display this?
http://www.blocks.scratchr.org/API.php?action=project&user=sparks&type=newest&return=image
?
I know how! Using cookies!
1. Image is displayed and cookie is set on user's computer
2. when it is clicked on, the cookie is used to send user to right url.
Offline
sparks wrote:
Hmmm, I don't know if cookies can be sent over images, that sounds potentially dangerous to me but it is a very good idea! I shall look into it!
They can... dangerous?
Offline
comp500 wrote:
sparks wrote:
Hmmm, I don't know if cookies can be sent over images, that sounds potentially dangerous to me but it is a very good idea! I shall look into it!
They can... dangerous?
LOL XD THE ATTACK OF THE CHOCOLATE CHIP COOKIES! (wait this is a joke right?) If not, he means like the computer cookies.
Offline
Pecola1 wrote:
comp500 wrote:
sparks wrote:
Hmmm, I don't know if cookies can be sent over images, that sounds potentially dangerous to me but it is a very good idea! I shall look into it!
They can... dangerous?
LOL XD THE ATTACK OF THE CHOCOLATE CHIP COOKIES! (wait this is a joke right?) If not, he means like the computer cookies.
nojoke
Offline
Hey, comp, amazing cookie idea! I didn't actually realize its potential until you guys made that joke about it I'm pretty sure that'll work.
Offline
LS97 wrote:
Hey, comp, amazing cookie idea! I didn't actually realize its potential until you guys made that joke about it I'm pretty sure that'll work.
:3
Offline
Hi! First of all, I would like to tell you how important this API is to many scratchers. Really, it is very hard to find a important topic without any of this!
However, I would really love a simple link which just shows stuff like "My newest Project, blahblah, has blahblah views, blahblah love-its, and blahblah downloads" in the style of my signature.
Oh, and sparks, can I use the thing you have in your sig until then? Thanks!
Offline
ProgrammingFreak wrote:
kayybee wrote:
Just wondering, is there a way to get the love its/views/other info for a specific project?
But that's not a specific project.
It'll change if the user uploads another project...
So, is there a way to find one's post count?
Last edited by kayybee (2011-10-02 22:49:39)
Offline
sparks wrote:
Not done much work with Cookies yet, I can't promise I'll look into it any time soon, my Uni course is very demanding atm...
ok, i can do it then give to chu...
Offline