Week 4: Single Page Web App

Is it sunny on Mars?
New features, new languages, new syntax! It's another week in DWD, and this time around we learned how to build single page web applications using jQuery with AJAX and experimented with transmitting JSON-formatted data to and from an Express server. For practice, I built an app to display a photograph taken by NASA's Mar's Curiosity Rover for any given day since it landed on the planet in August 2012. In this week's project the browser does all the work from the code in my html file: it makes a call to the NASA API and displays an image on the page for whatever date is submitted without refreshing the page; no data is sent nor received from my own server. I'm still wrapping my head around how all of this works, but my novice understanding is it's possible for my client-side browser to communicate with NASA's server and load the data dynamically through the use of a type of JavaScript called AJAX, and using the JQuery library makes AJAX methods a lot easier. Unlike the JSON data feed from the OpenWeatherMap example in class, I realized that NASA's feed contains an array of nested objects. The rover takes multiple images a day (over 332,000 since it started in 2012), and in order to render just one of them from any given day in my app, I needed to specify its index number when declaring the value to pull during the API call. To run this I set up a basic HTTP server, the same as from the first week of class.

Curious? Check it out here (for now): marsscapes

Code on GitHub

Final Project Proposal: Photo Booth App
I want to build an online photo booth app, and I have two ideas: 1) build a booth with my own custom image processing algorithms or 2) photograph users' as they look at other images, displaying both shots in a diptych at the end (to see the viewer and the viewed at the time of the viewing). I'm interested to use this latter design with the first idea, too. The second idea is a online remake of a Processing project and would allow me to share it with more people. For either, I'll need to learn how to serve over HTTPS, a secure version of HTTP, in order to utilize laptops' webcams. As part of my preparation this past week, I drafted a version of the second idea in P5 here.