CSCI 344: Spring 2023

Advanced Web Technology

CSCI 344: Spring 2023

UNCA Logo

Assignments > Tutorial 6: JavaScript: Working with external data

Due on Fri, 02/17 @ 11:59PM. 6 Points.

Introduction

In this week’s tutorial, we will be creating an interface to interact with a REST API. You are welcome to work solo or with a partner. Even if you work with a partner, everyone should submit their own files.

A few notes:

API Endpoint Documentation & Examples

Yelp

Spotify

Twitter

Your Tasks

Please download the starter files below and then complete the following tasks:

Tutorial 6 Starter Files

  1. Pick ONE of the REST APIs above (Yelp, Spotify, or Twitter).
  2. Create a web form to enable the user to ask the API a question.
  3. Attach an event handler to the “Submit” button. Feel free to copy the form from Tutorial 4 to get you started.
  4. Use the data that the user typed into the form as a basis for formulating the query.
  5. When the server responds, transform that data (using the map and join methods) into an HTML string that you will add to the DOM.
  6. Follow any additional provider-specific instructions below:

If you choose Yelp…

If you choose Yelp, allow your user to input both a search term and a location.

If you choose Spotify…

If you choose Spotify, allow your user to specify both a search term (q parameter) and a resource type (album, artist, or track).

If you choose Twitter…

If you choose Twitter, allow your user to specify both a search term (q parameter) and a result_type (mixed, recent, or popular).

What to Submit