kpoeltler / astronomy-flashcard-app Goto Github PK
View Code? Open in Web Editor NEWfront side of card displays an astronomical object and the backside of the card reveals facts about the object
front side of card displays an astronomical object and the backside of the card reveals facts about the object
using jupyter.org widgets with our data
Ideas on how to incorporate would be awesome
Create a PUT route the accesses the req.body
and updates the userDesc in the db where the id matches.
deciding to use EPIC as a picture source instead of the APOD API.
https://www.programmableweb.com/api/nasa-epic
Unit Tests are required for each function.
Here is a list of functions that will need to be included in this project:
This project needs to have a license file due to the use of the starter code from Stanford's CS Homework assignment 3
Be able to edit Description by user
TESTING
-- Must not have " inside the input from used -- escape them
-- Must not be HTML or JS Script too protect the integrity of the db from attack
SQL Code
USE astronomy_db;
INSERT INTO cards (userDesc)
values ("");
install npm init
express
body-parser
mysql
path
httr
jsonlite packages
Make sure we are getting data from our server for '/api/all' route
{
copyright: "Xiaohan Wang",
date: "2018-03-06",
explanation: "Why would the sky glow like a giant repeating rainbow? Airglow. Now air glows all of the time, but it is usually hard to see. A disturbance however -- like an approaching storm -- may cause noticeable rippling in the Earth's atmosphere. These gravity waves are oscillations in air analogous to those created when a rock is thrown in calm water. Red airglow likely originates from OH molecules about 87-kilometers high, excited by ultraviolet light from the Sun, while orange and green airglow is likely caused by sodium and oxygen atoms slightly higher up. While driving near Keluke Lake in Qinghai Provence in China, the photographer originally noticed mainly the impressive central band of the Milky Way Galaxy. Stopping to photograph it, surprisingly, the resulting sensitive camera image showed airglow bands to be quite prominent and span the entire sky. The featured image has been digitally enhanced to make the colors more vibrant. Follow APOD on: Facebook, Google Plus, Instagram, or Twitter",
hdurl: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_3887.jpg",
media_type: "image",
service_version: "v1",
title: "Colorful Airglow Bands Surround Milky Way",
url: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_1080.jpg",
userDesc : ""
}
Using the APOD API
-https://api.nasa.gov/api.html
-see what the data looks like at https://api.nasa.gov/index.html#live_example
-read the documentation to find out which parameters we can get from the Ajax request.
-parse the images
-importing the APOD data into the MySQL database.
-need at least 365 pictures coupled with its matching data/description.
If the picture does not have a description one will be written for it and added to the database
clicking the image should toggle to the description
We need a model for card items
creating a database of star names. Here is a url
https://www.naic.edu/~gibson/starnames/starnames.html
Add a get route for the path '/api/all' return a sample JSON
{
copyright: "Xiaohan Wang",
date: "2018-03-06",
explanation: "Why would the sky glow like a giant repeating rainbow? Airglow. Now air glows all of the time, but it is usually hard to see. A disturbance however -- like an approaching storm -- may cause noticeable rippling in the Earth's atmosphere. These gravity waves are oscillations in air analogous to those created when a rock is thrown in calm water. Red airglow likely originates from OH molecules about 87-kilometers high, excited by ultraviolet light from the Sun, while orange and green airglow is likely caused by sodium and oxygen atoms slightly higher up. While driving near Keluke Lake in Qinghai Provence in China, the photographer originally noticed mainly the impressive central band of the Milky Way Galaxy. Stopping to photograph it, surprisingly, the resulting sensitive camera image showed airglow bands to be quite prominent and span the entire sky. The featured image has been digitally enhanced to make the colors more vibrant. Follow APOD on: Facebook, Google Plus, Instagram, or Twitter",
hdurl: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_3887.jpg",
media_type: "image",
service_version: "v1",
title: "Colorful Airglow Bands Surround Milky Way",
url: "https://apod.nasa.gov/apod/image/1803/AirglowRings_Wang_1080.jpg",
userDesc: ""
}
For example
-- Receiving and testing
-- GET the API data after midnight of every day
Set a default of "" empty string - just in case the INSERT INTO cards do not match
E.g. the 3rd one did not have a copyright
PUT the API call into db cards table
Match titles from API with column names
Remove column titles "copyright" :
Remove { at the start and } at the beginning and the end
Trim each value using trim()
Create Database. Insert data I have manually collected through myPHPAdmin
I think using this would be cool,http://www.chartjs.org/docs/latest/
Write a function to render the image to the page
cardsArr
cardArr[currentCard]
is rendered to the page as an imageSue
Make an AJAX put request to test the PUT route.
Wireframe Front-end
This should be done on the first day
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.