Domanda

Sto analizzando un feed RSS dal seguente URL:

http://rss.sciam.com/ScientificAmerican-Global?format=xml

// $xml_text is filled with the contents read from the URL
$xml_parser = xml_parser_create();
$res = xml_parse($xml_parser, $xml_text);

if (!$res) {
  $error =
    xml_error_string(xml_get_error_code($xml_parser)).
    " at line ".
    xml_get_current_line_number($xml_parser);
}

// $error contains: "SYSTEM or PUBLIC, the URI is missing at line 1"

FeedValidator.org afferma che si tratta di un buon feed.

Come posso ottenere il parser XML di PHP per aggirare questo errore?

MODIFICA : sembra che stiano reindirizzando questo feed in un'altra posizione in base all'utente-agente. Il mio script PHP non sta ricevendo il feed corretto.

È stato utile?

Soluzione

Il codice funziona per me, devi sbagliare il testo.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top