1 package org.cacert.gigi.util;
3 import java.io.BufferedReader;
5 import java.io.IOException;
6 import java.io.InputStreamReader;
7 import java.io.PrintWriter;
9 import java.util.zip.ZipEntry;
10 import java.util.zip.ZipInputStream;
12 public class HighFinancialValueFetcher {
14 public static void main(String[] args) throws IOException {
16 if (args.length > 1) {
17 max = Integer.parseInt(args[1]);
19 try (PrintWriter fos = new PrintWriter(new File(args[0]), "UTF-8"); ZipInputStream zis = new ZipInputStream(new URL("https://s3.amazonaws.com/alexa-static/top-1m.csv.zip").openStream())) {
22 while ((ze = zis.getNextEntry()) != null) {
23 System.out.println(ze.getName());
24 BufferedReader br = new BufferedReader(new InputStreamReader(zis, "UTF-8"));
26 while ((line = br.readLine()) != null) {
27 String[] parts = line.split(",");
28 int i = Integer.parseInt(parts[0]);
33 fos.println(parts[1]);
34 System.out.println(line);