August 2019
Intermediate to advanced
158 pages
3h 13m
English
The purpose of the <show-trending> Web Component is to first make a call to the API and then show the most trending GIFs. For this component, the API that we will be using is, https://api.giphy.com/v1/gifs/trending.
Like the previous API, this also returns an array of objects that contains the URL and other metadata. To take a look at the documentation for this API, visit this link: https://developers.giphy.com/docs/#operation--gifs-trending-get.
Now that we know how the API works, lets take a look at the code for the <show-trending> Web Component:
export default class ShowTrending extends HTMLElement { constructor() { // We are not even going to touch this. super(); this.key = 'YOUR_KEY'; this.url = 'https://api.giphy.com/v1/gifs/trending'; ...Read now
Unlock full access