share project with URL

Issue #251 resolved
Wenjie Wu created an issue

I noticed that the microblocks IDE has some great features for sharing code/blocks:

I really like these features.

Sometimes I want to refer to my projects in my blog tutorials, and I expect the feature: users click on a URL to open the project I have prepared.

Just like the share code button in Brython editor :

When I click the Share code, everything is encoded into the url (no backend support required!)

https://brython.info/tests/editor.html?lang=en&code=for%20i%20in%20range%2810%29%3A%0A%20%20%20%20print%28i%29

When someone clicks on the url, he or she will be taken to the expected project.

Since the ubp file is a plain text file, it seems technically feasible.

The lengthy url doesn't seem to be a problem either, as it can be hidden under meaningful names:

the python demo

By the way, does MicroBlocks have plans to build a community(project storage is a basic requirement)? Just like snap! or MIT scratch.


Other related issues:

Comments (7)

  1. John Maloney repo owner

    Hi, Wenjie.

    Nice idea to encode an entire project into a URL!

    We’ve also been experimenting with a way to include the code for script inside the PNG file. In fact, I’m working on that mechanism right now! I’m pretty sure it can be extend to encode the result into a URL.

    What I like about your URL idea is that it doesn’t require saving the project on a server. You can paste the URL into a web page, send it in an email, share it on forums or in the Issue tracker.

    Bernat implemented a blocks rendering system based on a similar idea but that system relies on our server to covert the script into a PNG and we worried about server load and potential security issues so, even thought it was a cool idea, we decided to remove that feature.

    But a combination of encoding scripts in PNG file and your idea to encode them in a URL (when you don’t actually need a picture or want to encode the entire project) will satisfy the same needs.

    Re: By the way, does MicroBlocks have plans to build a community(project storage is a basic requirement)? Just like snap! or MIT scratch.

    No plans for that. It’s a major effort to manage a user community, as I know from Scratch and Bernat and Jens know from Snap. However, I can imagine partnering with other organizations that might want to build user communities around MicroBlocks. If that’s of interest to you or Finn, we can discuss…

  2. Wenjie Wu reporter

    it doesn’t require saving the project on a server. You can paste the URL into a web page, send it in an email, share it on forums or in the Issue tracker.

    That's also what I like most!

    encoding scripts in PNG file 

    Awesome! It seems that most of the work is already done!

    It’s a major effort to manage a user community

    Couldn't agree more.

    However, I can imagine partnering with other organizations that might want to build user communities around MicroBlocks. If that’s of interest to you or Finn, we can discuss…

    Both Finn and I are interested and we will think about it.

  3. John Maloney repo owner

    Done. Use file menu “copy project URL to clipboard” command to create a URL that encodes the entire project.

  4. Log in to comment