-
-
Save JelaniThompson/bd5d9127b80641b4483b9273f97df289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
let topFifty = 'https://itunes.apple.com/us/rss/toppodcasts/limit=50/json', | |
names = [], | |
images = [], | |
summaries = [] | |
// Charts will be for displaying top podcasts, trending podcasts, etc. | |
class Chart extends React.Component { | |
render() { | |
// Fetch metadata | |
fetch(topFifty).then(function(response) { | |
return response.json().then(function(json) { | |
json.feed.entry.forEach(function(datum) { | |
names.push(datum["im:name"].label) | |
images.push(datum["im:image"][0].label) | |
summaries.push(datum.summary.label) | |
}) | |
}) | |
}) | |
console.log(names) | |
console.log(images) | |
let display = names.map(function(nameVal) { | |
return <h1>{nameVal}</h1> | |
}) | |
return ( | |
<div> | |
{display} | |
</div> | |
) | |
} | |
} | |
export default Chart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment