New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch examples from p5 website repo #203

Merged
merged 9 commits into from Dec 1, 2016

Conversation

Projects
None yet
2 participants
@yining1023
Member

yining1023 commented Nov 23, 2016

Fixes #149

To run this, we need to

  • add github Oauth application Client ID and Client Secret in the .env file, like:
    CLIENT_ID=xxxxxxxx
    CLIENT_SECRET=xxxxxxxxx
  • $ npm install
  • $ npm run fetch-examples
    Then open Examples in the editor, it should show the sketch list below:

screen shot 2016-11-23 at 3 16 29 am

To do list and questions:

  • Some examples require assets(images and audio files), save those assets on S3
  • Set up a cron job that runs this task periodically

For now, each example's name is Category : sketch name, e.g: Hello P5 : song. What do you think of the naming method? @catarak. I'm open to other format. I also think it would be good to have category folders in the sketch list eventually.

Show outdated Hide outdated fetch-examples.js
@catarak

This comment has been minimized.

Show comment
Hide comment
@catarak

catarak Nov 23, 2016

Member

This is awesome! 🎉 🎉 🎉

I think the naming convention is good. I think it's clear what it means. It would be nice to have folders, but we'll get there when we get there, considering how long it took me to add folders to files...

Member

catarak commented Nov 23, 2016

This is awesome! 🎉 🎉 🎉

I think the naming convention is good. I think it's clear what it means. It would be nice to have folders, but we'll get there when we get there, considering how long it took me to add folders to files...

@yining1023

This comment has been minimized.

Show comment
Hide comment
@yining1023

yining1023 Nov 23, 2016

Member

Yay! Thank you! I made some changes that you suggested.

For the next step(saving assets on S3), my question is:
should I do something like this? It can find a file in one project and update it. Some projects need assets, some don't, so I need to go through each project's sketch.js and find out if it needs what particular assets and then add it?

Member

yining1023 commented Nov 23, 2016

Yay! Thank you! I made some changes that you suggested.

For the next step(saving assets on S3), my question is:
should I do something like this? It can find a file in one project and update it. Some projects need assets, some don't, so I need to go through each project's sketch.js and find out if it needs what particular assets and then add it?

@catarak

This comment has been minimized.

Show comment
Hide comment
@catarak

catarak Nov 23, 2016

Member

I think you would use the s3 node package, and generate a unique id for each file in the way I do when uploading files in the editor (see aws.controller.js), upload the files, and then you would do something similar to the code you linked to.

Member

catarak commented Nov 23, 2016

I think you would use the s3 node package, and generate a unique id for each file in the way I do when uploading files in the editor (see aws.controller.js), upload the files, and then you would do something similar to the code you linked to.

@catarak

This comment has been minimized.

Show comment
Hide comment
@catarak

catarak Dec 1, 2016

Member

I'm just going to merge this, and we can break out the known broken examples into separate issues:

  • Instance Container needs to be handled as a special case: broken down into four sub examples and added as a HTML file rather than a JS file
  • Operator Precedence Something involving the loop protect code is breaking this example
  • Reverb, Convolution Reverb, and another sound example are broken as discussed in #212
Member

catarak commented Dec 1, 2016

I'm just going to merge this, and we can break out the known broken examples into separate issues:

  • Instance Container needs to be handled as a special case: broken down into four sub examples and added as a HTML file rather than a JS file
  • Operator Precedence Something involving the loop protect code is breaking this example
  • Reverb, Convolution Reverb, and another sound example are broken as discussed in #212
@catarak

This comment has been minimized.

Show comment
Hide comment
@catarak

catarak Dec 1, 2016

Member

Also I noticed that the Convolution Reverb example is loading two assets with no name and a messed up url:
screen shot 2016-12-01 at 5 44 22 pm
screen shot 2016-12-01 at 5 45 06 pm
I think it might have to do with the .ogg files?

Member

catarak commented Dec 1, 2016

Also I noticed that the Convolution Reverb example is loading two assets with no name and a messed up url:
screen shot 2016-12-01 at 5 44 22 pm
screen shot 2016-12-01 at 5 45 06 pm
I think it might have to do with the .ogg files?

@yining1023

This comment has been minimized.

Show comment
Hide comment
@yining1023

yining1023 Dec 1, 2016

Member

Oh, sorry I forgot to fix this.
In the Convolution Reverb example code, it has two lines like this:
rawImpulse = loadSound('assets/' + cVerb.impulses[currentIR].name);
And the exmaple.js is picking up empty assets names which is not necessary. I just fixed it.

Member

yining1023 commented Dec 1, 2016

Oh, sorry I forgot to fix this.
In the Convolution Reverb example code, it has two lines like this:
rawImpulse = loadSound('assets/' + cVerb.impulses[currentIR].name);
And the exmaple.js is picking up empty assets names which is not necessary. I just fixed it.

@catarak

This comment has been minimized.

Show comment
Hide comment
@catarak

catarak Dec 1, 2016

Member

no worries, you are a boss for testing all of these examples

Member

catarak commented Dec 1, 2016

no worries, you are a boss for testing all of these examples

@catarak catarak merged commit 29de5fc into processing:master Dec 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment