How to get the XML of a project without opening it?

My project just got broken. I think I know why. Any way I could get the XML of the project and try and fix it?

Nevermind. Found it!

What a coincidence, I just need that function!

Can you share the solution with us ?

It’s a bit JSy, you have to say
XML_Serializer.prototype.parse = function(x){window.RECOVERY = x}
in the console, then open your project. The load will fail, but then type console.log(RECOVERY) in the console, and copy the result string from the button. Lastly put it in a XML file.

Alternatively, just use the official (although undiscoverable) method mentioned in the manual:

There are several ways to include a pointer to a project in the URL when starting Snap! in order to load a project automatically. You can think of such a URL as just running the project rather than as running Snap!, especially if the URL says to start in presentation mode and click the green flag. The general form is https://snap.berkeley.edu/run#verb:project&flag&flag…
The “verb” above can be any of open, run, cloud, present, or dl. The last three are for shared projects in the Snap! cloud; the first two are for projects that have been exported and made available anywhere on the Internet.

The verb dl (short for “download”) does not start Snap! but just downloads a cloud-saved project to your computer as an .xml file. This is useful for debugging; sometimes a defective project that Snap! won’t run can be downloaded, edited, and then re-saved to the cloud.

There’s also a “Download” button on the community site

Boy, this keeps getting better and better!

Thanks! This is the way.

We really need to encourage folks to use the rest of the community site and not just the IDE. :slight_smile:

I noticed something when i try to download my own project form the community site: If the project isin’t shared, i can’t download it… (It’s my own project…)


(file not available on the site)

If i share the project, i have no problem to download it …

I agree, but I have to admit, I’m one of those ide only people. I just remembered seeing a download button last time I was on it.

same here. I haven’t used the community site any more than half a dozen times in the last 2 years.

Thx! My bad, I was in a rush to recover it

i think project comments could go a long way for this

That’s true. maybe we can make that happen at some point.

I think you miss this…

Sorry just needed more time to look into this.

Private projects should download just fine. Do you get some error message or nothing happens?

error in the browser: file not available on the site
(win10,google chrome: )

but like no warning in the browser or an error message from Snap! or the community site? hmm. I would try to copy the URL and open in a new tab directly and see what happens when you load the tab. My only guess is that some how Chrome isn’t treating you as logged in.

This is what I get when opening it in a new tab

I’m guessing the browser just isn’t sending the cookies or the api isn’t properly accepting them

Hmm. Odd. your username is present, so it seems like you should be seen as being logged in. But the 404 suggests otherwise.

Do you have private browsing on at all?