MediaWiki:Strona główna.js: Różnice pomiędzy wersjami

Z Mammonopedia
Przejdź do nawigacji Przejdź do wyszukiwania
Utworzono nową stronę "fetch("https://www.youtube.com/feeds/videos.xml?channel_id=TWÓJ_CHANNEL_ID") .then(response => response.text()) .then(str => new window.DOMParser().parseFromString(str, "text/xml")) .then(data => { const entry = data.querySelector("entry"); const videoId = entry.querySelector("yt\\:videoId").textContent; const iframe = document.createElement("iframe"); iframe.width = "560"; iframe.height = "315"; iframe.src = `https://www.youtube.com/…"
 
m UWAGA! Usunięcie treści (strona pozostała pusta)!
Znacznik: Usunięcie całej zawartości strony
 
(Nie pokazano 6 wersji utworzonych przez 2 użytkowników)
Linia 1: Linia 1:
fetch("https://www.youtube.com/feeds/videos.xml?channel_id=TWÓJ_CHANNEL_ID")
 
  .then(response => response.text())
  .then(str => new window.DOMParser().parseFromString(str, "text/xml"))
  .then(data => {
    const entry = data.querySelector("entry");
    const videoId = entry.querySelector("yt\\:videoId").textContent;
    const iframe = document.createElement("iframe");
    iframe.width = "560";
    iframe.height = "315";
    iframe.src = `https://www.youtube.com/embed/${videoId}`;
    iframe.frameBorder = "0";
    iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
    iframe.allowFullscreen = true;
    document.getElementById("yt-latest-video").appendChild(iframe);
  });

Aktualna wersja na dzień 20:48, 29 lip 2025