Smargoth and then I heavily modified it to use CURL libraries. Author: Elana Shenton Author URI: http://www.clampcampus.com/ Update: http://www.clampcampus.com/wp-plugins/firefox */ function GetNumFirefoxDownloads($Url, $Port, $Timeout) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $Url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_TIMEOUT, $Timeout); curl_setopt($ch, CURLOPT_PORT, $Port); $XmlData = curl_exec($ch); curl_close($ch); if ($XmlData === NULL) return '?'; global $ReturnValue; global $IsRightTag; $ReturnValue = 'Error - Sorry no other data available.'; $IsRightTag = false; function XmlStartElement($Parser, $Name, $Attrs) { global $IsRightTag; if ($Name == 'DESCRIPTION') $IsRightTag = true; } function XmlEndElement($Parser, $Name) { global $IsRightTag; if ($Name == 'DESCRIPTION') $IsRightTag = false; } function XmlTextData($Parser, $Data) { global $ReturnValue; global $IsRightTag; if ($IsRightTag) $ReturnValue = $Data; } $XmlParser = xml_parser_create(); xml_set_element_handler($XmlParser, 'XmlStartElement', 'XmlEndElement'); xml_set_character_data_handler($XmlParser, 'XmlTextData'); xml_parse($XmlParser, $XmlData, true); xml_parser_free($XmlParser); return $ReturnValue; } // Function takes no arguments. This is what displays the Firefox count. function dsp_firefox_downloads() { $NumDownloads = GetNumFirefoxDownloads('http://feeds.spreadfirefox.com/downloads/firefox', 80, 25); echo $NumDownloads; } ?>