samples/youtube/playlist.js
async function runSample() {
  // the first query will return data with an etag
  const res = await getPlaylistData(null);
  const etag = res.data.etag;
  console.log(`etag: ${etag}`);

  // the second query will (likely) return no data, and an HTTP 304
  // since the If-None-Match header was set with a matching eTag
  const res2 = await getPlaylistData(etag);
  console.log(res2.status);
}
async function runSample() {
  // the first query will return data with an etag
  const res = await getPlaylistData(null);
  const etag = res.data.etag;
  console.log(`etag: ${etag}`);

  // the second query will (likely) return no data, and an HTTP 304
  // since the If-None-Match header was set with a matching eTag
  const res2 = await getPlaylistData(etag);
  console.log(res2.status);
}
async function runSample ( ) { // the first query will return data with an etag const res = await getPlaylistData ( null ) ; const etag = res . data . etag ; console . log ( ` ${ etag } ` ) ; // the second query will (likely) return no data, and an HTTP 304 // since the If-None-Match header was set with a matching eTag const res2 = await getPlaylistData ( etag ) ; console . log ( res2 . status ) ; }
a very simple example of getting data from a playlist
a very simple example of getting data from a playlist