<?php
header('Content-type: text/xml');
print '<?xml version="1.0" encoding="UTF-8"?>';

$hostName="http://localhost:8080";
$apiUrl =$hostName.'/contests/json/xmlContests?page=0';
$result = json_decode(file_get_contents($apiUrl));
if($result->code==200) {
print  '<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
print '

<url>
        <loc>https://www.crowdanalytix.com/</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/how-it-works</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/solutions</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/solutions/retail</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/solutions/manufacturing</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/solutions/healthcare</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/team</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/about-us</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/contact-us</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/team</loc>
        <lastmod>2019-03-29T09:00:04.413Z</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/community</loc>
        <lastmod>2015-07-24T14:18:18+00:00</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.80</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/jq/listForums.html</loc>
        <lastmod>2015-07-24T14:18:18+00:00</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.41</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/jq/privacyPolicy.html</loc>
        <lastmod>2015-07-24T14:18:18+00:00</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.41</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/jq/solversAgreement.html</loc>
        <lastmod>2015-07-24T14:18:18+00:00</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.41</priority>
    </url>
    <url>
        <loc>https://www.crowdanalytix.com/jq/faq.html</loc>
        <lastmod>2015-07-24T14:18:18+00:00</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.41</priority>
    </url>


';

    $resultArray=$result->data;
    for($i=0; $i<count($resultArray); $i++){
      $slugUrl=$resultArray[$i];
     print '<url><loc>'.htmlspecialchars($slugUrl).'</loc>
		 	<changefreq>monthly</changefreq>
	 		<priority>0.80</priority>
			</url>';
    }
    print '</urlset>';
  }

?>
