rss feed
loadHTML($html);
$xpath = new DOMXPath($dom);
$items = [];
$links = $xpath->query("//a[contains(@href, '/life-style/relationships/pets') and contains(@href, 'photostory')]");
for ($i = 0; $i < $links->length && $i < 10; $i++) {
$node = $links->item($i);
$href = $node->getAttribute('href');
$title = trim($node->nodeValue);
// Avoid duplicates
if (!in_array($href, array_column($items, 'link'))) {
$items[] = [
'title' => $title,
'link' => 'https://timesofindia.indiatimes.com' . $href,
'pubDateRfc' => date(DATE_RSS),
'description' => 'Auto-fetched from TOI Pets category.'
];
}
}
?>
'; ?>
TOI – Pets Category Feed
https://timesofindia.indiatimes.com/life-style/relationships/pets
Latest articles from the Times of India Pets category
en-us
-
]]>
<![CDATA[]]>
