Udemy Course Creation Date

This script adds udemy course creation date of course to last updated panel.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name        Udemy Course Creation Date
// @namespace   Violentmonkey Scripts
// @match       https://www.udemy.com/course/*
// @grant       none
// @version     1.0
// @license     MIT
// @author      ad3m
// @description This script adds udemy course creation date of course to last updated panel.
// ==/UserScript==

const courseId = document.querySelector("[data-clp-course-id]").getAttribute("data-clp-course-id");
const updated = document.querySelector(".last-update-date>span");

fetch(`https://www.udemy.com/api-2.0/courses/${courseId}/?fields[course]=created`)
  .then(response => response.json())
  .then(data => {
    let creationDate = new Date(data.created).toLocaleDateString();
    updated.textContent = `Created ${creationDate} - ${updated.textContent}`;
  });