bugfix for handling tickerforum.org

This commit is contained in:
2025-05-15 15:30:17 +00:00
parent 968e5d9d41
commit a88c328413

View File

@@ -41,9 +41,15 @@
return file_get_contents($cachefile);
}
$url=$_GET["url"];
$feed=new SimpleXmlElement(file_get_contents($url)); // read feed into object
$url=$_GET["url"];
$ch=curl_init(); // 8 Apr 25: market-ticker.org wants a user agent set
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$feed=new SimpleXmlElement(curl_exec($ch)); // read feed into object
curl_close($ch);
// type 1
foreach ($feed->item as $entry) // fix up each entry
{