$enc->setAttribute('length', $url_info['download_content_length']);
$enc->setAttribute('type', $url_info['content_type']);
- $dom->appendChild($enc);
-
- return $dom->saveXML($enc);
+ return $enc;
}
/**
}
/**
- * Load a stylesheet if the web site is supported.
- */
- private function loadStylesheet($host) {
- $stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl";
- if (FALSE === file_exists($stylesheet)) {
- trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR);
- return NULL;
- }
-
- $stylesheet_contents = Tweeper::getUrlContents($stylesheet);
-
- $xslDoc = new DOMDocument();
- $xslDoc->loadXML($stylesheet_contents);
-
- $xsltProcessor = new XSLTProcessor();
- $xsltProcessor->registerPHPFunctions();
- $xsltProcessor->setParameter('', 'generate-enclosure', $this->generate_enclosure);
- $xsltProcessor->importStylesheet($xslDoc);
-
- return $xsltProcessor;
- }
-
- /**
* Convert json to XML.
*/
private static function jsonToXml($json, $root_node_name) {
}
/**
+ * Load a stylesheet if the web site is supported.
+ */
+ private function loadStylesheet($host) {
+ $stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl";
+ if (FALSE === file_exists($stylesheet)) {
+ trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR);
+ return NULL;
+ }
+
+ $stylesheet_contents = Tweeper::getUrlContents($stylesheet);
+
+ $xslDoc = new DOMDocument();
+ $xslDoc->loadXML($stylesheet_contents);
+
+ $xsltProcessor = new XSLTProcessor();
+ $xsltProcessor->registerPHPFunctions();
+ $xsltProcessor->setParameter('', 'generate-enclosure', $this->generate_enclosure);
+ $xsltProcessor->importStylesheet($xslDoc);
+
+ return $xsltProcessor;
+ }
+
+ /**
* Convert the site content to RSS.
*/
public function tweep($src_url) {