Practical - YouTube API
- YouTube API
- Your page has an entry field in which you can type a search term.
- When you click a submit button,
your page searches the
on YouTube for videos matching that term.
- You do this using the YouTube API with a
- This returns a function wrapped round data.
- Your page parses the data in order to display a nice preview of the videos.
- You will need to register with YouTube to get an API key.
- The API needs to know "channel id".
To find channel id:
View Source of channel page and find:
- To see the structure of the data returned:
- Read the YouTube docs.
- Type variable name in JS console and click through.
- Output complex objects to console.
- Check for empty list:
If no videos are returned, display an error message explaining the list is empty.
- Your page should be running at some URL.
You should keep this URL secret from other students.
And also so as not to expose your API key.
(Not a disaster, but just good practice.)
- You need to tell me the secret URL in your documentation.
What to submit
- Your documentation should have:
- Name and IDs of student(s).
- URL of page so I can try it out.
- Printout of code.
- Printout of code should be:
- Fixed-width font.
- Landscape mode.