Open shiffman opened 10 years ago
So I've been playing with options for this and I managed to recreate something like the current setup using Parse in the place of anonymous gists and it works pretty well.
Parse is designed for just this kind of scenario where you have an app that needs a backend component, but don't require anything super specialized. Right now, I think the two best options would be something based on Parse or something based on Wordpress.
Parse is amazingly simple to get going, but would require more work to create administration features. The free tier is pretty limited, but I can't imagine we'd go beyond it. My only complaint is that it seems to be noticeably slower than GitHub was.
Wordpress would make administration super easy, but automating the addition of new posts would be a little annoying (there is a REST API on the way, but it isn't in the current release and would still require some weird workarounds for auth). We'd also end up with a weird divide between the main Jekyll-driven site on GitHub and the Wordpress site hosted elsewhere.
I think that Wordpress as an application backend is interesting, but at the moment I'm leaning toward Parse. I think I could get a very basic gallery going within a couple of hours.
@shiffman, if you make an account at Parse I should be able to invite you as a collaborator. I think most of the foundations are in place, so it should just be a matter now of nailing down the interface.
Great, I have an account under daniel at shiffman dot net.
Picking up this discussion here I agree it would be good to (a) alert users that there work will be included in a gallery and (b) add an option to "opt-out"? Given there is no personal information I think that we can have the default be including in the gallery.
@reas, sorry if it wasn't clear, but all of the content in the gallery right now is just very quick tests from me. There's no way to access the anonymous gists from last year, so I just made filler content to begin laying out the gallery.
All of those should be deleted before launch, but I do think it might be a good idea for us to pre-populate the gallery a little, maybe by hitting up the ITP mailing lists for quick contributions.
As far as floating interesting content to the top, I think we have three options:
CodePen.io uses a combination of these and lets visitors sort by "Picks", Popular and Recent.
A featured flag and view count are both relatively simple to implement. I'm not sure "likes" would work very well for us since everything is anonymous.
All great. The "sort by" featured and most viewed seem like good goals.
I took a stab at this, though it could use some more styling.
I implemented "featured as a score instead of as a boolean. I thought this might give some more flexibility for curating the page, but it could also just be set as 1 or 0 if that proves easiest.
I took at look at the current state and I think this is a terrific start. I think we'll probably have comments and ideas, but these will likely come into play once it starts populating. Would it make sense to try to get a class or group to use the tutorial in the next few days to seed some content and test bugs?
@scottgarner what's the process for administration? Should I login into Parse and play around there or I think you perhaps mentioned you were thinking about building a simple admin panel?
@REAS if you want to take a peek at http://hello.processing.org/gallery/ I'd love to hear if you have any more thoughts design-wise. @lmccart you might be interested in taking a peek at this too as this is a direction that would make a lot of sense for p5 someday.
You're definitely able to jump in on Parse and make changes, but the process is a little tedious because you're matching object id strings. I added some light admin features to the site, but they require a separate login (which is easy to create on Parse, but the process is a little goofy).
I'll email you login details so you can take a look. Basically it just adds an admin button to every gallery page, which triggers an overlay to change settings. Currently, you can set a "featured score" to change the sketch's placement in the gallery, hide/unhide the sketch and delete it entirely.
Fantastic, thanks for the info! Just out of curiosity how are you generated the thumbnail images?
It actually turned out to be pretty simple. You can get base64-encoded jpeg data directly from a canvas element and Parse has support for a file datatype that takes base64-encoded data.
var processingCanvas = document.getElementById("editorCanvas"),
uri = processingCanvas.toDataURL('image/jpeg'),
base64 = uri.slice(uri.indexOf(',') + 1),
processingImage = new Parse.File("sketch.jpg", { base64: base64 });
You can use a similar approach to save screenshots of a running sketch, but saving files directly from javascript is still a little wonky in some browsers. Filesaver.js makes it more reliable.
@scottgarner super cool! gives me lots of ideas..
@shiffman, Thoughts on the best way to link to this? The header seems like the right place, but things get really tight. I wonder if we could do something different with the Hour of Code link?
Hmmmm, tough one. Yeah, I think it's got to be in the header I can't think of anywhere else. Let's try adding it to the About / Guide / Help / etc? We can also add something to the about page. And yes, we might be able to shorten or move the Hour of Code link if we need to.
I got everything to fit reasonably well. I was thinking about putting icons next to the page links (About, Guide, etc.) but there's very little room left.
This is an enhancement to think about for the future. I'm really enjoying finding all the shared pages (e.g. http://hello.processing.org/display/#7858783) and it might be nice to accumulate them somewhere (10 most recent things made with hello processing?)