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

#651 2012-04-01 11:51:43

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

sparks wrote:

LiquidMetal wrote:

Hi sparks,
I just updated my signature, and while I was playing around with it, I noticed it can be slow to load, and does not load all at once.  I was wondering if you could make a single call script to get an image that links directly to the project.  You would put all the images in one call to the api, and there would be less overhead.  I'll explain more in depth if you need it.

Thanks!

Hey! I like the new sig!

I understand that loading time would be much reduced, but it may lower the level of customization available. I suppose it could be done in one image using a really long url like

http://www.blocks.scratchr.org/API.php?type=myProjects&display=nlfd&number=1&lovesImage=anImageUrl&favesImage=urlToImage&downloadsImage=urlToImage&background=urlToImage

or something. (nlfd would tell it to display name, loves, faves and downloads in that order)my main worry with this is that it would still be accessing image urls for all the parts of the sig, which would slow down the loading of the one image so that whole sig would take longer to load...

Maybe display should have number codes:
0= link
1= name
2= views ----> Does this exist yet?
3= loves
4= faves
5= downloads
6= everything

How about one single background image for the whole thing? When I put my sig images into an html document, clicking on any leaves a little dotted grey outline around the segment of the image that I pressed.  If the api returned only one image, then...

http://www.blocks.scratchr.org/API.php?type=myProjects&display=6&number=1&bgImage=anImageUrl&font_size=10&xpos1=12&ypos1=25&xpos2=35&ypos2=25&xpos3=58&ypos3=25&textr=0&textg=0&textb=0...

it would be a lot cleaner.


Are there font size / color defaults?

Would it be possible to use an image of a one pixel wide column of picture, and tile it until there is enough room for the required text + X pixels, then use the next logo image, etc;?

Would it be possible to return an image that links directly to the newest project, instead of linking to the API, which thinks a little bit and only then sends you to the project?  This would also provide a better feeling of security for anyone who doesn't know anything about this API, so the link is going to scratch and not some "random" website.

Thanks!

Last edited by LiquidMetal (2012-04-01 11:54:28)

Offline

 

#652 2012-04-01 13:17:08

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

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

I like your API format idea. It's very clean, the ponly problem with it might be that it is quite difficult to put together - lots of text. A creator would most likely need to be used  tongue

I can't get it to redirect straight to the project without linking to the API first, as the API can't physically change anything in your sig, so it cannot change the link to the project, it has to link to itself, and change the contents of the redirect script. Most people won't mind this, anypony who feels afraid to click should be reassured by the word scratch in the link...


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

Offline

 

#653 2012-04-02 08:46:12

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

If you can return an image, can't you return an image with a link tag on it?

Maybe the API's being faster would help.  Is there really no way to get the url as text before the click?

Offline

 

#654 2012-04-02 08:54:59

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

I would help with it... If you teach me how  tongue

Offline

 

#655 2012-04-02 12:12:36

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

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

Images and links are very different, and you can't return either an image OR a link tag to this page.

Here's how the API works:

for an image:
Scratch is asked to display an image using the bbcode:

Code:

www.blocks.scratchr.org/API.php?user=sparks&action=projects&type=newest&return=image&num=1

This never changes on the Scratch site, that code will always look the same. You may notice that it isn't linking to an image, it's linking to a page and just sending a little info to the page too. When Scratch views the page to try and display the image, a PHP script on that page notices that Scratch is looking at it, grabs the information about the person and such and then quickly draws up a picture to match what Scratch is asking for. It then displays this image and nothing else on that page and Scratch it tricked into thinking that it's just an image and displays it on the page.

for an URL:

Scratch is asked to make a link in the text with the code:

Code:

[url]http://blocks.scratchr.org/API.php?scratchify=imageshack.us&user=sparks&action=projects&type=newest&return=link&num=1[/url]

This never changes on the Scratch site, that code will always look the same and Scratch will always link to the API page. When a Scratch user clicks the link, they're taken to the API page, which notices that because return is set to link, the user just wants to be taken to another place, so it quickly works out a new URL based on the info sent, such as working out the URL to the newest project of that user, and then redirects the user to that page.

Essentially the problem is the Scratch does not allow HTML or PHP to be used on the forums. Everything dynamic like the API has to be processed off-site.

I'm very annoyed that I was unable to put the image URL in the example above into a code box with img tags, please go here to support the oddness of this and raise awareness

Last edited by sparks (2012-04-02 12:24:11)


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

Offline

 

#656 2012-04-02 20:50:54

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

sparks wrote:

Essentially the problem is the Scratch does not allow HTML or PHP to be used on the forums. Everything dynamic like the API has to be processed off-site.

Ahh... That makes things difficult. So what does scratch use on the forums? And why do they not allow html or php?

Offline

 

#657 2012-04-03 04:35:30

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

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

They use BBcode. That's the square-bracket tags you see like [b]bold[/b]

The reason that HTML is not allowed in posts is that HTML can be used to do a lot of things that could damage the forums or make them less safe. HTML, for example, could include an external javascript file and cause a popup to appear each time the page loads, which is something that can obviously be abused.

PHP is not allowed because it is a very powerful tool that could be used very maliciously on the forums to gather data on people, or hide rude comments from admins.

BBcode is basically allowing a few HTML tags that cannot really be abused whilst blocking all others.


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

Offline

 

#658 2012-04-03 09:06:52

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

Is there anything we could try pushing for that would help here and have a chance?

Last edited by LiquidMetal (2012-04-03 09:07:26)

Offline

 

#659 2012-04-03 09:14:38

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

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

LiquidMetal wrote:

Is there anything we could try pushing for that would help here and have a chance?

Why? The API works fine via image rendering and redirects, why increase the risk levels of the fora just so it can be a few seconds faster?


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

Offline

 

#660 2012-04-04 23:00:47

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

I meant that will not compromise forum safety.  And that could put a custom link.

Offline

 

#661 2012-04-05 16:41:26

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

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

On the text render-er, it blocks any image that is not a png. Could that be edited so it allows gif, jpeg and bmp, and also let it allow the text render-er ITSELF as a background, and allow tinyurl? Because right now, i cannot  get more than one line by tynyurl-ing the image with the first line of text and inputing that as a background image, nor can i replace & and = with their encoded values (namely %26 and %3D) and passing that url as a background image for the second line of text. Also it means i cant write text on any images generated by the API such as my latest projects.

Last edited by joefarebrother (2012-04-09 11:53:46)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#662 2012-04-05 17:46:49

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

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

Hmm, I'll have to look into it  smile


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

Offline

 

#663 2012-04-06 01:22:54

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

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

When is my random text coming?  wink


http://i46.tinypic.com/6yd4c0.png

Offline

 

#664 2012-04-06 04:02:07

lallaway12
Scratcher
Registered: 2012-01-04
Posts: 500+

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

The pic`s are lost!!!


http://i49.tinypic.com/2re4ied.png

Offline

 

#665 2012-04-06 14:24:23

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

My sig stopped working?

Offline

 

#666 2012-04-09 11:48:55

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

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

LiquidMetal wrote:

My sig stopped working?

The rest of the API seems to be working fine.. are you sure the problem isn't in your tinyurl or with your image host, cos that's where it looks like the problem lies to me  smile


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

Offline

 

#667 2012-04-09 14:41:57

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

I copied the urls, and verified that the images are still there, but the api does not return them.  It is strange, because it worked the day I submitted it...

Last edited by LiquidMetal (2012-04-09 14:42:47)

Offline

 

#668 2012-04-09 14:50:40

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

This is the current code.  I tried another image sharer but it didn't help.  I also tried .png versions of the files.

[iimg]http://bit.ly/H4t2CQ[/iimg][iimg]http://bit.ly/HvvWEK[/iimg][iimg]http://bit.ly/HyKBg4[/iimg][img]http://bit.ly/HyLgy5[/iimg][iimg]http://i.imgur.com/BVxl2.gif[/iimg]

It complained about the images tags, and suggested imgur this time (With or withough the code tags).

Last edited by LiquidMetal (2012-04-09 14:58:27)

Offline

 

#669 2012-04-10 07:01:09

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

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

I think i figured it out! Because the scratch team are blocking the api, maybe it's blocked in sigs, too!


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#670 2012-04-10 08:39:21

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

joefarebrother wrote:

I think i figured it out! Because the scratch team are blocking the api, maybe it's blocked in sigs, too!

The thing is, it works for some people.  And, I went to the api's url, and it still did not show.

Offline

 

#671 2012-04-10 09:56:04

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

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

Fixed it  smile


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

Offline

 

#672 2012-04-10 17:56:03

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

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

Edit: It is broken again, but this time, I don't think it is the API's fault, because the image shows there!  What should I do? I didn't change anything!!

Last edited by LiquidMetal (2012-04-12 11:12:17)

Offline

 

#673 2012-04-13 09:57:57

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

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

now your a mod, you could talk to lightning about allowing images from blocks.scratchr.org


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#674 2012-04-13 10:48:56

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

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

sparks wrote:

I like your API format idea. It's very clean, the ponly problem with it might be that it is quite difficult to put together - lots of text. A creator would most likely need to be used  tongue

I can't get it to redirect straight to the project without linking to the API first, as the API can't physically change anything in your sig, so it cannot change the link to the project, it has to link to itself, and change the contents of the redirect script. Most people won't mind this, anypony who feels afraid to click should be reassured by the word scratch in the link...

why does this post still have the "neigh" filter?

Last edited by joefarebrother (2012-04-13 10:57:24)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#675 2012-04-13 11:42:01

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

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

Cos I wrote that by hand.

I video-chatted with Lightnin just now and he's making sure to whitelist the images!


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

Offline

 

Board footer