+function parse_options_query_string()
+{
+ $options = array();
+
+ if (isset($_GET['src_url']))
+ $options['src_url'] = $_GET['src_url'];
+
+ return $options;
+}
+
+
+if (php_sapi_name() != 'cli')
+ $options = parse_options_query_string();
+else
+ $options = parse_options_cli($argv, $argc);
+
+if (!isset($options['src_url']))
+ die(usage($argv));
+
+$url = parse_url($options['src_url']);
+if (FALSE === $url || empty($url["host"]))
+ die("Invalid url: ${options['src_url']}\n");
+
+$stylesheet = __DIR__ . "/rss_converter_" . $url["host"] . ".xsl";
+if (FALSE === file_exists($stylesheet))
+ die("Conversion to RSS not supported: {$url["host"]}\n");