<html lang="en">

<html lang="en">

<!DOCTYPE html>

<html lang="en">

<head>

   <meta charset="UTF-8" />

   <style>

       body {

           font-family: Arial, sans-serif;

           padding: 2rem;

           background: #f0f4f8;

       }

       h1 {

           color: #2c3e50;

           margin-bottom: 1rem;

       }

       a.tag {

           display: block;

           margin: 5px 0;

           font-size: 14px;

           color: #0000ee;

           text-decoration: underline;

       }

       a.tag:hover {

           color: #551A8B;

       }

   </style>

</head>

<body>

   <div id="result" style="margin-top: 20px;"></div>

   <script>

   const count = 1;

   const minLength = 0;

   const maxLength = 0;


   // Lista limbilor disponibile (coduri ISO)

   const languages = [

    "ar", "be", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", "et",

    "eu", "fa", "fi", "fr", "gl", "he", "hi", "hr", "hu", "hy", "id", "it",

    "ja", "ko", "lt", "lv", "ml", "nl", "no", "pl", "pt", "ro", "ru", "sk",

    "sl", "sr", "sv", "ta", "te", "th", "tr", "uk", "uz", "vi", "zh", "en",

    "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en",

    "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en",

    "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en",

    "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en"

   ];


   // Alegere aleatoare a unei limbi

   const language = languages[Math.floor(Math.random() * languages.length)];


   // Linkurile în care se inserează automat limba aleasă

   const linkBases = [

       `https://headlines-world.com/advanced-search.html?lang=${language}&q=`,

       `https://aepiot.com/advanced-search.html?lang=${language}&q=`,

       `https://aepiot.ro/advanced-search.html?lang=${language}&q=`,

       `https://allgraph.ro/advanced-search.html?lang=${language}&q=`,

       `https://multi-search-tag-explorer.headlines-world.com/advanced-search.html?lang=${language}&q=`,

       `https://multi-search-tag-explorer.aepiot.com/advanced-search.html?lang=${language}&q=`,

       `https://multi-search-tag-explorer.aepiot.ro/advanced-search.html?lang=${language}&q=`,

       `https://multi-search-tag-explorer.allgraph.ro/advanced-search.html?lang=${language}&q=`

   ];


   const customLinks = [

       ``,

   ];


   function shuffle(array) {

       for (let i = array.length - 1; i > 0; i--) {

           const j = Math.floor(Math.random() * (i + 1));

           [array[i], array[j]] = [array[j], array[i]];

       }

       return array;

   }


   async function generateTags(count, language, minLength, maxLength) {

       const result = document.getElementById("result");

       result.innerHTML = "";


       const apiUrl = `https://${language}.wikipedia.org/w/api.php?action=query&list=recentchanges&rcnamespace=0&rclimit=${count}&rcprop=title|timestamp&rctype=edit&format=json&origin=*`;


       try {

           const response = await fetch(apiUrl);

           const data = await response.json();

           const titles = data.query.recentchanges.map(item => item.title);

           const tags = [];


           titles.forEach(title => {

               const tag = title

                   .replace(/[^\p{L}\d\s]/gu, ' ')

                   .replace(/\s+/g, ' ')

                   .toUpperCase()

                   .trim();


               if (

                   tag.length >= minLength &&

                   (maxLength === 0 || tag.length <= maxLength)

               ) {

                   tags.push(tag);

               }

           });


           const uniqueTags = [...new Set(tags)];


           if (uniqueTags.length) {

               let tagLinks = [];


               uniqueTags.forEach((tag, index) => {

                   const randomLinkBase = linkBases[Math.floor(Math.random() * linkBases.length)];

                   const fullLink = randomLinkBase + encodeURIComponent(tag);

                   tagLinks.push(`<p><a href="${fullLink}" target="_self" class="tag">${tag}</a></p>`);


                   if (index === 0) {

                       tagLinks.push(`<p><a href="${fullLink}" target="_blank" class="tag">${fullLink}</a></p>`);

                   }

               });


               const insertMin = 2;

               const insertMax = Math.max(tagLinks.length - 2, 2);

               const positions = [];


               while (positions.length < customLinks.length) {

                   const pos = insertMin + Math.floor(Math.random() * (insertMax - insertMin + 1));

                   if (!positions.includes(pos)) positions.push(pos);

               }


               const shuffledCustomLinks = shuffle([...customLinks]);

               positions.sort((a, b) => a - b);

               positions.forEach((pos, i) => {

                   tagLinks.splice(pos + i, 0, shuffledCustomLinks[i]);

               });


               result.innerHTML = tagLinks.join(' ');

           } else {

               result.innerHTML = "";

           }

       } catch (err) {

           console.error(err);

           result.innerHTML = "";

       }

   }


   window.addEventListener('DOMContentLoaded', () => {

       generateTags(count, language, minLength, maxLength);

   });

</script>

</body>

</html>



Report Page