mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-22 02:25:48 +01:00
Download head-dump/heads.json from GitHub Pages instead of head-db.com
Details explained in 1ea1e06431
This commit is contained in:
parent
1ea1e06431
commit
aadf55fc0a
@ -221,13 +221,13 @@ public class EpicHeads extends SongodaPlugin {
|
||||
|
||||
private void downloadHeads() {
|
||||
try {
|
||||
InputStream is = new URL("http://www.head-db.com/dump").openStream();
|
||||
InputStream is = new URL("https://songoda.github.io/EpicHeads/heads.json").openStream();
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
|
||||
String jsonText = readAll(rd);
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONArray json = (JSONArray) parser.parse(jsonText);
|
||||
|
||||
try (FileWriter file = new FileWriter(getDataFolder() + "/heads.json")) {
|
||||
try (FileWriter file = new FileWriter(new File(getDataFolder(), "heads.json"))) {
|
||||
file.write(json.toJSONString());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user