Review AJAX with fetch
and JSON
Practice using JSON as a data format to process with JS
JSON is a way of saving or storing javascript objects (the technical term is "serializing" which is just a fancy word for turning an object into a savable string of characters)
Browser JSON methods:
JSON.parse( /* JSON string */ )
-- converts JSON string into Javascript object
JSON.stringify( /* Javascript Object */ )
-- converts a Javascript object into JSON text
api-tester.zip (starter HTML/CSS/JS)
https://www.reddit.com/r/subreddit/.json?limit=postcount
https://www.reddit.com/r/subreddit/search/.json?limit=postcount&q=searchquery
Examples:
To get JSON response about best and trending posts on Reddit:
https://www.reddit.com/r/best/.json?limit=postcount
https://www.reddit.com/r/trending/.json?limit=postcount
Examples:
More information about JSON data returned: Reddit Wiki
Examples:
Examples:
Examples: (note: you need to add an api key parameter to get this data)
https://api.themoviedb.org/3/discover/movie/?api_key=<yourkey>&sortby=popularity.desc
https://api.themoviedb.org/3/search/movie/?api_key=<yourkey>&query=<searchterm>