Question
Problem 06: getTaxonPhotos() * * Write a function to get all sizes of the default photo for each of the identified * species in the
Problem 06: getTaxonPhotos() * * Write a function to get all sizes of the default photo for each of the identified * species in the iNaturalist results data. * * When an observation has been properly identified, it will have a `taxon` * property and value. When it does, one of the properties within `taxon` is * the `default_photo` property, which will look like this: * * default_photo: { * square_url: 'https://static.inaturalist.org/photos/575727/square.jpg', * attribution: '(c) hobiecat, some rights reserved (CC BY-NC)', * flags: [], * medium_url: 'https://static.inaturalist.org/photos/575727/medium.jpg', * id: 575727, * license_code: 'cc-by-nc', * original_dimensions: { width: 1035, height: 1035 }, * url: 'https://static.inaturalist.org/photos/575727/square.jpg?1384377507' * }, * * Each image on iNatrualist is stored in various sizes: small, medium, large, * original, and square (75 x 75 pixels). This is helpful when showing the image * at different sizes, to save on bandwidth when downloading. * * Convert each observation with a `taxon` identification to an Object that looks * like this, using the `default_photo` and its `url` properties: * * { * original: 'https://static.inaturalist.org/photos/575727/original.jpg', * square: 'https://static.inaturalist.org/photos/575727/square.jpg', * small: 'https://static.inaturalist.org/photos/575727/small.jpg', * medium: 'https://static.inaturalist.org/photos/575727/medium.jpg', * large: 'https://static.inaturalist.org/photos/575727/large.jpg', * } * * The URLs all follow the same pattern: * * https://[original-photo-domain]/photos/[photo ID]/[size].jpg * * Your function should return the new Array of photo size URLs
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started