Hardmath123 wrote:
You need to add a built-in URL shortener to Snap! to compress those crazy URLs.
That's a great idea. So, you think http://bit.ly/snap-project/xxxxxx or something like that?
I tried reading about the bit.ly API, though, and it's really complicated, because you need an account with them, and our server has to jump through hoops to get your account ID to put in the shortening request. Unless I'm misunderstanding the documentation.
Edit: ... and then they send us your bit.ly password! I sure hope Google's API isn't like that.
Edit 2: Oh pooh. You're not allowed to use bit.ly if you're under 13. I think that means we can't rely on it.
Edit 3: Ah, but tinyurl.com seems usable without all that hair.
Last edited by bharvey (2012-11-18 12:01:49)
Offline
Might want to investigate Yourls. Looks reasonably simple to implement.
Offline
May I suggest goo.gl? Their API is located at http://googlecode.blogspot.com/2011/01/ … s-api.html
(yes, I've been lurking here for some time now)
Offline
bharvey wrote:
alloplastic wrote:
deprecated blocks like "object" and "the script."
The OOP features that were added in BYOB 3.1 aren't in Snap! yet and probably won't be until 4.1, so hold off on converting OOP projects.
Okay, thanks for the clarification. It's good to have the decision of when to migrate made for me -- and to know that there will likely be a painless migration path. :-)
I'll be ready to take the leap, and I'll second all of the requests for easy ways to store & share projects in Snap. Also, it would be great if students could somehow create standalone executables, and/or start screens instead of the green flag, so that they could have the dream of creating "real" software.
Offline
bharvey wrote:
Hardmath123 wrote:
You need to add a built-in URL shortener to Snap! to compress those crazy URLs.
That's a great idea. So, you think http://bit.ly/snap-project/xxxxxx or something like that?
I tried reading about the bit.ly API, though, and it's really complicated, because you need an account with them, and our server has to jump through hoops to get your account ID to put in the shortening request. Unless I'm misunderstanding the documentation.
Edit: ... and then they send us your bit.ly password! I sure hope Google's API isn't like that.
Edit 2: Oh pooh. You're not allowed to use bit.ly if you're under 13. I think that means we can't rely on it.
Edit 3: Ah, but tinyurl.com seems usable without all that hair.
Well ideally you would write your own code on your own server, which would make things really simple, like just appending #Username<dash>Projectname to view a project whose code (XML) is hosted on a server. You can use XHRs to get the contents.
Offline
Hardmath123 wrote:
bharvey wrote:
Hardmath123 wrote:
You need to add a built-in URL shortener to Snap! to compress those crazy URLs.
That's a great idea. So, you think http://bit.ly/snap-project/xxxxxx or something like that?
I tried reading about the bit.ly API, though, and it's really complicated, because you need an account with them, and our server has to jump through hoops to get your account ID to put in the shortening request. Unless I'm misunderstanding the documentation.
Edit: ... and then they send us your bit.ly password! I sure hope Google's API isn't like that.
Edit 2: Oh pooh. You're not allowed to use bit.ly if you're under 13. I think that means we can't rely on it.
Edit 3: Ah, but tinyurl.com seems usable without all that hair.Well ideally you would write your own code on your own server, which would make things really simple, like just appending #Username<dash>Projectname to view a project whose code (XML) is hosted on a server. You can use XHRs to get the contents.
+1, you can let the owner update the project
Offline
Hardmath123 wrote:
like just appending #Username<dash>Projectname to view a project whose code (XML) is hosted on a server.
Sure, but that isn't the problem I'm trying to solve. Once a project is in the cloud, it has a reasonably short URL no matter what. I want a client-side "shorten URL" option in the File menu that takes the super-long URL that's in the browser's URL bar after a (local) save and shortens it.
In fact, you know, it just occurs to me, that would give us 90% of the capability of a cloud server, with tinyurl doing the heavy lifting instead of us!
One of you js programmers with too much time on his/her hands want to implement this and send Jens the code?
The right thing would then be to keep in localstore a collection of the user's shortened URLs for ease of later loading.
And maybe instead of cluttering the File menu, the right thing to do is have the Save option give a dialog like
Save to... () localstore () new browser window as XML () tinyurl shortener () Snap! server {once that's running} project name [_______________] {preloaded if not first save} [ ] remember this choice ("Save as..." to change)
Checking the checkbox would set a preference cookie (for the radio button choice, not the project name).
Things in {braces} above are comments.
Tinyurl supports custom URLS, so it could be tinyurl.com/Snap!-XXX where XXX is the project name.
EDIT: Never mind, I tried turning my tree project into a tinyurl on their web site and got "URI too long."
Last edited by bharvey (2012-11-19 17:42:02)
Offline
I don't think URL shortening is going to be an efficient option. I can barely copy and paste projects in that form as it is. Localstorage, a Snap! server, and XML should be sufficient.
Offline
shadow_7283 wrote:
I don't think URL shortening is going to be an efficient option. I can barely copy and paste projects in that form as it is. Localstorage, a Snap! server, and XML should be sufficient.
Sure, once the server is running. I'm hoping for a short term solution. And also, URL shortening is a no-login-needed option.
Almost all the URL shorteners boggle at Snap! projects, though, either because of length or because they forbid XML to avoid XSS malware. However, urlgator.com seems to work. Unfortunately, they redirect you by way of their own page (I'm guessing it has advertising on it, but I never see advertising ). But give this a try:
http://urlgator.com/snaptree
Offline
bharvey wrote:
shadow_7283 wrote:
I don't think URL shortening is going to be an efficient option. I can barely copy and paste projects in that form as it is. Localstorage, a Snap! server, and XML should be sufficient.
Sure, once the server is running. I'm hoping for a short term solution. And also, URL shortening is a no-login-needed option.
Almost all the URL shorteners boggle at Snap! projects, though, either because of length or because they forbid XML to avoid XSS malware. However, urlgator.com seems to work. Unfortunately, they redirect you by way of their own page (I'm guessing it has advertising on it, but I never see advertising). But give this a try:
http://urlgator.com/snaptree
Yeah, ads.
Are you sure you can't just encodeURIComponent(…) the URL fragment first? Shorteners with no length limit shouldn't have a problem with that.
EDIT: Oh my…I just got stuck in an infinite Snap! do-you-want-to-leave-this-page loop that almost made me force-quit Chrome.
Last edited by nXIII (2012-11-19 19:07:22)
Offline
nXIII wrote:
Are you sure you can't just encodeURIComponent(…) the URL fragment first? Shorteners with no length limit shouldn't have a problem with that.
No, I'm not sure; I'm just copy-and-pasting by hand. Feel free to do a better experiment. (But, lots of sites turn the <brokets> into % codes when I paste, fwiw.)
EDIT: Oh my…I just got stuck in an infinite Snap! do-you-want-to-leave-this-page loop that almost made me force-quit Chrome.
Reproducible?
Last edited by bharvey (2012-11-19 20:53:58)
Offline
bharvey wrote:
EDIT: Oh my…I just got stuck in an infinite Snap! do-you-want-to-leave-this-page loop that almost made me force-quit Chrome.
Reproducible?
It's never happened before, so probably not. I have been having some other problems with Snap! permanently freezing the tab, though. I'll try restarting Chrome when I have fewer tabs open
Offline
Another working URL shortener: shrinkr.me. Example:
http://shnk.me/69585
... but for some reason it only works in Firefox.
Offline
bharvey wrote:
Another working URL shortener: shrinkr.me. Example:
http://shnk.me/69585
... but for some reason it only works in Firefox.
It's because it's only partially urlencoding the URL and Snap's decoder check gets confused and tries to decode the whole thing, so Chrome &c. throw an "URI malformed" exception.
Last edited by nXIII (2012-11-20 19:43:51)
Offline
xly wrote:
When I look inside the "tree" block name all "item of ..." refer to a void list.
Anything wrong?
No, that's how it's supposed to be. Those ITEM blocks you're looking at are inside a FOR EACH ITEM OF (BRANCHES) block, and BRANCHES is a list of lists. So each sublist is plugged in everywhere there's an empty input slot in the script inside the FOR EACH.
Hmm, maybe Dan is right that the FOR EACH block should have an (ITEM) upvar instead of the text word ITEM; the resulting code might be more intuitive.
Offline
bharvey wrote:
Hmm, maybe Dan is right that the FOR EACH block should have an (ITEM) upvar instead of the text word ITEM; the resulting code might be more intuitive.
Just when you finally convinced me about blank inputs as implicit parameters...
Offline
bharvey wrote:
xly wrote:
Impossible to save the project when the tree is still drawn into the graphic window.
Works for me. This is in Chrome? On Windows? And you just loaded from that urlgator URL and did a save?
Windows +Chrome.
This "save" bug is not specific to the server use. I've the same bug with my own applications when the window graphic is "overcrowded" (probably too many pixels)
Offline