import org.dom4j.Element;
import org.wamblee.crawler.Action;
import org.wamblee.crawler.Configuration;
import org.wamblee.crawler.Crawler;
import org.wamblee.crawler.Page;
import org.dom4j.Element;
import org.wamblee.crawler.Action;
import org.wamblee.crawler.Configuration;
import org.wamblee.crawler.Crawler;
import org.wamblee.crawler.Page;
- public static void main(String[] args) throws Exception {
- String configFileName = args[0];
- String starturl = args[1];
-
+ public static void main(String[] aArgs) throws Exception {
+ String configFileName = aArgs[0];
+ String starturl = aArgs[1];
+
FileOutputStream fos = new FileOutputStream(new File(LOG_FILE));
PrintStream os = new PrintStream(fos);
FileOutputStream fos = new FileOutputStream(new File(LOG_FILE));
PrintStream os = new PrintStream(fos);
HttpClient client = new HttpClient();
// client.getHostConfiguration().setProxy("localhost", 3128);
HttpClient client = new HttpClient();
// client.getHostConfiguration().setProxy("localhost", 3128);
Crawler crawler = new CrawlerImpl(client, config);
System.out.println("Retrieving: " + starturl);
Crawler crawler = new CrawlerImpl(client, config);
System.out.println("Retrieving: " + starturl);
- for (Action channel: channels) {
- examineChannel(channel.getName(), channel.execute().getAction("right-now").execute());
+ for (Action channel : channels) {
+ examineChannel(channel.getName(), channel.execute().getAction(
+ "right-now").execute());
-
- private static void examineChannel(String aChannel, Page aPage) {
- Action[] programs = aPage.getActions();
- for (Action program: programs) {
+
+ private static void examineChannel(String aChannel, Page aPage) throws PageException {
+ Action[] programs = aPage.getActions();
+ for (Action program : programs) {