Commit 2d528d61 authored by Moises Bensadon's avatar Moises Bensadon
Browse files

add reddit dropdown to gui

parent 260ad7dc
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ public class MainApp extends JFrame {
        setLayout(new BorderLayout());

        // Module selector
        String[] modules = {"Select Module", "Crawler", "Checker", "Corrector"};
        String[] modules = {"Select Module", "Web Crawler", "Reddit Crawler", "Checker", "Corrector"};
        moduleSelector = new JComboBox<>(modules);

        // User inout entry field and run button
@@ -34,9 +34,12 @@ public class MainApp extends JFrame {
            String input = urlField.getText().trim();

            switch (selectedModule) {
                case "Crawler":
                case "Web Crawler":
                    runCrawler(input);
                    break;
                case "Reddit Crawler":
                    runCrawler("https://www.reddit.com/r/"+input);
                    break;
                case "Checker":
                    runChecker(input);
                    break;
@@ -84,7 +87,7 @@ public class MainApp extends JFrame {
        System.setOut(printStream);

        // Run the crawler
        webCrawler.crawl(1); // Adjust the limit (DEFAULT SET TO 1)
        webCrawler.crawl(5); // Adjust the limit (DEFAULT SET TO 1)

        // Restore standard output and update the GUI
        System.setOut(oldStream);