BKH Udemy Get ID, Creation Date, Image

trying to make the world a better place!

当前为 2024-08-18 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         BKH Udemy Get ID, Creation Date, Image
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  trying to make the world a better place!
// @author       BKH
// @license      MIT
// @match        https://www.udemy.com/course/*
// @icon         https://www.google.com/s2/favicons?domain=tampermonkey.net
// @grant        GM_addStyle
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require      https://greasyfork.org/scripts/446257-waitforkeyelements-utility-function/code/waitForKeyElements%20utility%20function.js?version=1059316

// ==/UserScript==
var $ = window.$;
var x = document.body.getAttribute("data-clp-course-id");
//var button = document.createElement("Button");
//$(button).attr("id","SomeID");
//button.innerHTML = x;
//button.style = "top:0;left:0;position:fixed;z-index:99999;padding:20px;";
 $.get("https://www.udemy.com/api-2.0/courses/"+x+"/?fields[course]=created,image_750x422", function(data, status){
     var id = data.id;
     var img = data.image_750x422;
     var date = data.created;
     var d = new Date(date);
     var day = d.getDate();
     var month = d.getMonth() + 1;
     var year = d.getFullYear();
     day = day.toString().padStart(2, '0');
     month = month.toString().padStart(2, '0');
     var forD = day+"/"+month+"/"+year;
     waitForKeyElements (".clp-lead__element-meta", elemento);
     function elemento (jNode) {
         $(".clp-lead__element-meta").append('<div class="clp-lead__element-item hecho" style="display: flex; flex-direction: column; gap: 12px"><div style="padding:8px;color:aqua;border: 1px solid aqua;border-radius:8px">ID: ' + id + '</div><div style="padding:8px;color:aqua;border: 1px solid aqua;border-radius:8px">Ngày tạo: ' + forD + '</div><div style="padding:8px;color:aqua;border: 1px solid aqua;border-radius:8px">Link ảnh: <a href="'+ img +'" target="_blank" style="color: aqua">Download ảnh</a>' + '</div></div>');
     }
  });

$(document).ready(function() {});
//document.body.appendChild(button);