<?php
header_remove();
header("Content-Type: application/xml; charset=utf-8");
header("X-Content-Type-Options: nosniff");

$base = "https://dnschecker.website";
$langs = ['en', 'tr', 'de', 'ru'];
$today = date('Y-m-d');
$popularDomains = ['google.com', 'facebook.com', 'youtube.com', 'twitter.com', 'instagram.com', 'linkedin.com', 'netflix.com', 'microsoft.com'];

$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">';

$xml .= '<url><loc>'.$base.'/</loc><lastmod>'.$today.'</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url>';

foreach($langs as $lang) {
    $xml .= '<url>';
    $xml .= '<loc>'.$base.'/'.$lang.'</loc>';
    $xml .= '<lastmod>'.$today.'</lastmod>';
    $xml .= '<changefreq>weekly</changefreq>';
    $xml .= '<priority>0.9</priority>';
    foreach($langs as $l) {
        $xml .= '<xhtml:link rel="alternate" hreflang="'.$l.'" href="'.$base.'/'.$l.'"/>';
    }
    $xml .= '</url>';
}

foreach($popularDomains as $domain) {
    foreach($langs as $lang) {
        $xml .= '<url>';
        $xml .= '<loc>'.$base.'/'.$lang.'/'.$domain.'/a</loc>';
        $xml .= '<lastmod>'.$today.'</lastmod>';
        $xml .= '<changefreq>monthly</changefreq>';
        $xml .= '<priority>0.6</priority>';
        $xml .= '</url>';
    }
}

$xml .= '</urlset>';

echo trim($xml);
exit;