+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");
+
+$tweeper = new Tweeper($stylesheet, $options['generate_enclosure']);
+echo $tweeper->tweep($options['src_url']);