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 PrintWriter fos = new PrintWriter(new File(args[0]), "UTF-8");
20 ZipInputStream zis = new ZipInputStream(new URL("https://s3.amazonaws.com/alexa-static/top-1m.csv.zip").openStream());
23 while ((ze = zis.getNextEntry()) != null) {
24 System.out.println(ze.getName());
25 BufferedReader br = new BufferedReader(new InputStreamReader(zis, "UTF-8"));
27 while ((line = br.readLine()) != null) {
28 String[] parts = line.split(",");
29 int i = Integer.parseInt(parts[0]);
34 fos.println(parts[1]);
35 System.out.println(line);