【发布时间】:2014-11-07 15:21:36
【问题描述】:
是否可以使用 AngelList API 在不知道所有公司 ID 的情况下获取 AngelList 网站内的整个公司(初创公司)列表?
或者,有没有办法获取所有公司 ID?
我正在尝试使用随机 URL 的 JSON 解析器,因为 AngelList URL 随机用于位置、市场和其他。
我想在一个 txt 文件中获取所有 AngelList 初创公司和公司
for (int h = 1612; h<=1885; h++){
do {
// change the URL as per the requirement and also paginating it
String libURL = "https://api.angel.co/1/tags/" + h + "/startups?page="
+ i;
InputStream in = URI.create(libURL).toURL().openStream();
// writing each page into a seperate file
FileOutputStream fout = new FileOutputStream(
"/Users/Fabio/Desktop/FilesAngellist/file" + i + ".txt");
byte data[] = new byte[1024];
int count;
while ((count = in.read(data, 0, 1024)) != -1) {
fout.write(data, 0, count);
}// end of while
if (i == 1) {
DownloadJobJson db = new DownloadJobJson(); // code to pull
// "last_page" value
// from json file
pagenumber = db.DownloadJobJson1();
}// end of if
i = i + 1;
} while (i <= pagenumber);// end of do-while()
}
这是来自 AngelList URL 的 JSON 下载器的代码
【问题讨论】:
-
1) 这可能违反了 angellist 的使用条款。你问过他们的支持吗?你试过什么?
-
我正在等待支持人员的回复,我正在尝试使用 JSON 解析器,但这很难做到,因为 AngelList URL 是随机的
标签: java url web-crawler