This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#501 2011-08-13 03:52:29

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Right, I've fixed the content type for image returns so you can click "view image" and you'll see the picture, not a load of gobbledygook! (wow, seriously? My spell-checker recognises 'gobbledygook' but not 'altogether'? ... anyway) Adding the content type to the entire API, I found, broke all the link attributes taking you to another page so I had to manually put it in several times, but I suppose it's worth it, thanks LS97 for the incredibly big hint that I'd missed that  tongue

Do you use chrome? I think Chrome's the one that doesn't recognize altogether -- I've had the exact same problem before (well, not with the gobble stuff). But yeah, add to dictionary.

What do you mean broke all the link attribs?

Offline

 

#502 2011-08-13 03:54:50

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

nathanprocks wrote:

sparks wrote:

How odd! Normal sized for me! I have no idea what's causing it  tongue

i think it just depends on what computer/browser you are using. when i am using a public computer with Internet Explorer 8, it shows the images very big like that. when i am on my laptop with Chrome, it shows the images as its normal size.

I'm wondering if maybe there's some sort of resize command/header we could add in -- It's weird though, 'cause it should set the size to the original image's size... I'll investigate.

Offline

 

#503 2011-08-13 15:21:47

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

^ a resize attribute would actually be a really useful thing for the API, letting users make the icons for their projects smaller to fit the sig, for example. When I looked into this the only way I could see it working was to get the original image, then physically save an edited (resized) version of it to the host site's files, then get that, then delete it.

*guilty face* I've never actually looked to see if my API works in anything but Firefox. Usually when I work on a website I test it in all major browsers but since this contains no HTML I didn't think it necessary...

Last edited by sparks (2011-08-13 15:22:48)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#504 2011-08-13 16:04:04

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

^ a resize attribute would actually be a really useful thing for the API, letting users make the icons for their projects smaller to fit the sig, for example. When I looked into this the only way I could see it working was to get the original image, then physically save an edited (resized) version of it to the host site's files, then get that, then delete it.

*guilty face* I've never actually looked to see if my API works in anything but Firefox. Usually when I work on a website I test it in all major browsers but since this contains no HTML I didn't think it necessary...

A resize attribute would be great! I suggest you look into the Imagick class (there should be some tutorials on php.net). It has really useful methods.

EDIT
By the way, if you have no idea how to use it, welcome to the club  wink

Last edited by LS97 (2011-08-13 16:05:55)

Offline

 

#505 2011-08-14 01:38:32

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: ITopic: self-updating images and links in posts!

So... would I be able to make text showing the title of my newest game, with the thumbnail image of it in the background?


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#506 2011-08-14 05:05:19

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

floppy_gunk wrote:

So... would I be able to make text showing the title of my newest game, with the thumbnail image of it in the background?

You can already, partially! The good thing about this stuff is that it's recursive. Just tinyURL the URL of the project background, then wait until we make another little feature. Then you can tinyURL the URL for the latest project name, and add it into the custom text creator (the one I coded, to be clear).

Yeah, that wasn't clear at all. Basically no, but you will soon enough.

Offline

 

#507 2011-08-17 09:55:14

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

In IE, it's disgustingly huge.

Offline

 

#508 2011-08-17 13:55:19

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.

Offline

 

#509 2011-08-17 13:59:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

ProgrammingFreak wrote:

http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.

That's cool! Didn't exactly know how to use it, but now I noticed the example  tongue
Looking forward to result!

Offline

 

#510 2011-08-17 14:12:47

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

LS97 wrote:

ProgrammingFreak wrote:

http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.

That's cool! Didn't exactly know how to use it, but now I noticed the example  tongue
Looking forward to result!

Code:

<?php
header('Content-type: image/jpeg');

$image = new Imagick('test.jpg');
$image->adaptiveResizeImage(634,768);

echo $image;
?>

Using Image:
[img]tinyurl.com/3px3a4x[/img]

Gives:

The image “http://localhost/resize.php” cannot be displayed, because it contains errors.

-_-

Last edited by ProgrammingFreak (2011-08-17 14:14:03)

Offline

 

#511 2011-08-17 14:20:43

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Offline

 

#512 2011-08-18 15:21:46

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

I just got accepted into the university I applied for today!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#513 2011-08-18 15:54:55

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I just got accepted into the university I applied for today!

Congrats!  big_smile

Offline

 

#514 2011-08-20 05:04:37

whizzer
Scratcher
Registered: 2008-05-27
Posts: 500+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Try out Rum's Like button - Click to learn about adding to your thread

Last edited by whizzer (2011-08-20 05:05:09)


http://i46.tinypic.com/33df6me.png I'm whizzer0 for all things Minecraft.

Offline

 

#515 2011-08-20 05:10:12

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I just got accepted into the university I applied for today!

Yay! But tell me, what does this have to do with "self-updating images and links in posts"?

Offline

 

#516 2011-08-20 06:52:51

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I just got accepted into the university I applied for today!

Wow, congratulations!  big_smile

Offline

 

#517 2011-08-20 10:41:41

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: ITopic: self-updating images and links in posts!

I'm back from holiday! Not that I told any of you that I went on holiday... But, I did. Anyway, what progress has been made since I was last here?


http://i.imgur.com/zeIZW.png

Offline

 

#518 2011-08-20 15:48:20

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Not much, I was in Switzerland! I fixed the header type though  tongue


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#519 2011-08-26 17:46:45

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#520 2011-08-27 08:17:16

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?

I could.  smile

Offline

 

#521 2011-08-27 08:31:45

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?

Great idea!!
And, by the way, how's comp's JS SDK doing?

Offline

 

#522 2011-08-27 08:37:33

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

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.  wink

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:

[img]http://blocks.scratchr.org/API.php[/img]

But thats not all. You add a

Code:

?user=USERNAME&action=onlineStatus

To 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!  big_smile
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 a

Code:

&type=

to the end of the url and your possibilies extend even further!
Here are your options:
A square button:

Code:

&type=square

Text:

Code:

&type=text

You can even do your own image! To do so, add:

Code:

&online=URLOFIMAGEFORONLINE&offline=URLOFIMAGEFOROFFLINE

You are probably thinking, "Wow. Thats so long I'll never understand it!". But I can help you with it!  big_smile
Lemme break it down to you:
First, we add the username:

Code:

user=USERNAME

Then we add the action:

Code:

&action=onlineStatus

Remember, we've done this before. So don't sweat it!  smile

Next we add the image to show when the user is online:

Code:

&online=URLOFIMAGEFORONLINE

Finally 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!  big_smile

Last edited by ProgrammingFreak (2011-08-27 08:39:36)

Offline

 

#523 2011-08-27 08:50:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks, I was thinking that to make the API use easier you could do some regex replacements in .HTACCESS.

Like Scratch did in their API: "http://scratch.mit.edu/api/getproject/" does not have a directory for each project, but rather uses HTACCESS to replace some GET variable with a fake directory.

Offline

 

#524 2011-08-27 09:09:44

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

I sort of changed my sig and screwed it up.


http://i46.tinypic.com/dw7zft.png

Offline

 

#525 2011-08-27 09:12:02

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Hey, is there a way to get a users favorites?

Offline

 

Board footer