Vila Verde

O comerciante Vítor Manuel ("Farturas Vítor Manuel") ofereceu, esta terça-feira, farturas aos utentes do Lar do Trabalhador, que neste momento estão a ser tratados por membros da Cruz Vermelha Portuguesa, nas instalações do Centro Comunitário de Prado. Também os profissionais da extensão de saúde da Vila de Prado foram abrangidos por esta oferta. Este foi…
6 anos atrás
Jornal O Desportivo
<?php
function fetch_rss($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
curl_close($ch);
if (!$data) {
return null;
}
return simplexml_load_string($data);
}
function time_ago($datetime) {
$time = strtotime($datetime);
$diff = time() - $time;
if ($diff < 60) return $diff . ' segundos atrás';
if ($diff < 3600) return floor($diff / 60) . ' minutos atrás';
if ($diff < 86400) return floor($diff / 3600) . ' horas atrás';
if ($diff < 604800) return floor($diff / 86400) . ' dias atrás';
return date('d/m/Y H:i', $time);
}
$rss = fetch_rss('https://www.desportivovaledohomem.pt/category/destaque/feed/');
if (!$rss) {
echo 'Erro ao carregar o feed.';
return;
}
$items = $rss->channel->item;
$count = 0;
echo '<div class="rss-posts">';
foreach ($items as $item) {
if ($count >= 5) break;
$title = (string) $item->title;
$link = (string) $item->link;
$pubDate = (string) $item->pubDate;
$timeAgo = time_ago($pubDate);
$categories = [];
foreach ($item->category as $cat) {
$categories[] = (string) $cat;
}
$categoryText = isset($item->category[0]) ? (string) $item->category[0] : '';
echo '<div class="rss-post">';
echo '<p class="rss-meta">' . esc_html($timeAgo) . ' - ' . esc_html($categoryText) . '</p>';
echo '<h3 class="rss-title"><a href="' . esc_url($link) . '" target="_blank">' . esc_html($title) . '</a></h3>';
echo '</div>';
$count++;
}
echo '</div>';
?>.rss-posts {
font-family: "MYRIAD PRO";
font-weight: 400;
}
.rss-post {
padding: 10px 0;
border-bottom: 1px solid #8E8E8D;
}
.rss-meta {
color: #828282;
font-size: 11px;
margin-bottom: 0px;
font-weight: 600;
}
.rss-title {
font-size: 14px;
line-height: 1.4;
margin: 0;
}
.rss-title a {
text-decoration: none;
color: #363636;
font-family: "Myriad Pro";
font-weight: 400;
font-size: 17px;
}
.rss-post:last-child {
border: none;
}Últimas Notícias
2 anos atrás - Destaque, Região, Vila Verde
Aproveite. Verão de S. Martinho chega mais cedo
2 anos atrás - Agenda / Cultura, Destaque, Vila Verde
Moure serve Pica no Chão no próximo sábado















