<?php
	$url = "https://jobicy.com/?feed=job_feed&posts_per_page=15";
	$invalidurl = false;
	$actual_link = $_SERVER['HTTP_HOST'];
	if(@simplexml_load_file($url)){
		$feeds = simplexml_load_file($url);
		$namespaces = $feeds->getNamespaces(true);
	}else{
		$invalidurl = true;
		echo "<h2>Invalid RSS feed URL.</h2>";
	}

	$i=0;
	if(!empty($feeds)){

		$sitelink = $feeds->channel->link;

		foreach ($feeds->channel->item as $item) {
			$title = $item->title;
			$link = $item->link;
			$company = $item->children($namespaces['job_listing'])->company;
			$job_type = $item->children($namespaces['job_listing'])->job_type;
			$description = $item->description;
			$postDate = $item->pubDate;
			$pubDate = date('D, d M Y',strtotime($postDate));

			if($i>=15) break;
	?>
			<div class="remote-job-i5evlnd1122g">
				<p><a class="remote-job-title-b8yhdq471k8c" target="_blank" rel="noreferrer noopener" href="<?php echo $link; ?>?utm_source=<?php echo $actual_link; ?>&utm_medium=corvid"><?php echo $title; ?></a> (<?php echo $job_type; ?> &#8901; <?php echo $company; ?>)</p>
			</div>

			<?php
			$i++;
		}
	}else{
		if(!$invalidurl){
			echo "<h2>No item found</h2>";
		}
	}
?>