Skip to content

Instantly share code, notes, and snippets.

@be7DOTis
Created October 7, 2017 16:32
Show Gist options
  • Save be7DOTis/ad21fee20745af32d1369fa838be48d4 to your computer and use it in GitHub Desktop.
Save be7DOTis/ad21fee20745af32d1369fa838be48d4 to your computer and use it in GitHub Desktop.
Example JSON for zoobeacon
{
"animalName": "African Elephant", //This should be used as the page title and header
"animalNameLatin": "Loxodonta africana", //This should be the subtitle
"Type" :"Mammal", //Basic Facts
"Country's Found": ["zambia","kenya","congo"] //basic facts
"weight": 2000, //Basic Facts
"weightInAvgHuman": 25, //Basic Facts
"height": 3, //Basic Facts
"heightInAvgHuman": 2, //Basic Facts
"food": "grass"
"conservationInfo" { //Has its own section
"country": "foo", //From Red List
"growthForms": "foo", //From Red List
"Habitat": "foo", //From Red List
"Measure": "foo", //From Red List
"Region": "foo", //From Red List
"Species": "foo", //From Red List
"threat": "endangered" //This should be in a box at the top of conservationInfo, background changes color depending. //From Red List
"donationLinks" : "https://elephantaidinternational.org/projects/elephant-refuge-north-america" //this is probs sources manually
}
}
@jakewtaylor
Copy link

jakewtaylor commented Oct 7, 2017

Updated:

{
    "name": "African Elephant",
    "latinName": "Loxodonta Africana",
    "class": "Mammal", 
    "countriesFound": [
        "zambia",
        "kenya",
        "congo"
    ],
    "weight": "2000kg",
    "weightInAvgHuman": 25,
    "height": "3m",
    "heightInAvgHuman": 2,
    "food": "grass",
    "conservationInfo": {
        "country": "foo",
        "growthForms": "foo",
        "habitat": "foo",
        "measure": "foo",
        "region": "foo",
        "Species": "foo",
        "threat": "endangered",
        "donationLinks": "https://elephantaidinternational.org/projects/elephant-refuge-north-america"
    }
}

@be7DOTis
Copy link
Author

be7DOTis commented Oct 7, 2017

var AnimalSchema = new Schema({
name : String,
latinName: String,
class: String,
countriesFound: [String],
weightInKg: Number,
weightInAvgHuman: Number,
heightInMeters: Number,
heightInAvgHuman: Number,
food: String,
habitat: String,
speed: String,
fact: String
conservationInfo: {
status: String,
changeInRange: String,
threats: String,
population: Number,
actions: String,
donationLinks: [String],
findOutMore: [String]
}
});

@jakewtaylor
Copy link

Code formatting. 🙃

var AnimalSchema = new Schema({
  name : String,
  latinName: String,
  class: String,
  countriesFound: [String],
  weightInKg: Number,
  weightInAvgHuman: Number,
  heightInMeters: Number,
  heightInAvgHuman: Number,
  food: String,
  habitat: String,
  speed: String,
  fact: String
  conservationInfo: {
    status: String,
    changeInRange: String,
    threats: String,
    population: Number,
    actions: String,
    donationLinks: [String],
    findOutMore: [String],
  },
});

@be7DOTis
Copy link
Author

be7DOTis commented Oct 7, 2017

class: String,
countriesFound: [String],
weightInKg: Number,
weightInAvgHuman: Number,
heightInMeters: Number,
heightInAvgHuman: Number,
food: String,
habitat: String,
speed: String,
fact: String,
conservationInfo: {
    status: String,
    changeInRange: String,
    threats: [String],
    population: Number,
    actions: [String],
    donationLinks: [String],
    findOutMore: [String]
}

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