]> WPIA git - gigi.git/blobdiff - util/org/cacert/gigi/util/HighFinancialValueFetcherAlexa.java
add: Implement use of Cisco Umbrella 1 Million domain list
[gigi.git] / util / org / cacert / gigi / util / HighFinancialValueFetcherAlexa.java
diff --git a/util/org/cacert/gigi/util/HighFinancialValueFetcherAlexa.java b/util/org/cacert/gigi/util/HighFinancialValueFetcherAlexa.java
new file mode 100644 (file)
index 0000000..17c9182
--- /dev/null
@@ -0,0 +1,22 @@
+package org.cacert.gigi.util;
+
+import java.io.File;
+import java.io.PrintWriter;
+
+public class HighFinancialValueFetcherAlexa extends HighFinancialValueFetcher {
+
+    public HighFinancialValueFetcherAlexa(File f, int max) {
+        super(f, max, "https://s3.amazonaws.com/alexa-static/top-1m.csv.zip");
+    }
+
+    @Override
+    public void handle(String line, PrintWriter fos) {
+        String[] parts = line.split(",");
+        // Assert that the value before the "," is an integer
+        Integer.parseInt(parts[0]);
+
+        emit(fos, parts[1]);
+        System.out.println(parts[1]);
+    }
+
+}