Compare commits

...

2 Commits

Author SHA1 Message Date
Christian Koop aadf55fc0a
Download head-dump/heads.json from GitHub Pages instead of head-db.com
Details explained in 1ea1e06431
2023-04-06 10:40:50 +02:00
Christian Koop 1ea1e06431
Copies 'http://www.head-db.com/dump/' into the git repository
It is directly downloaded from `http://www.head-db.com/dump/` (a couple minutes ago).
A future commit will change the EpicHeads code to download the JSON from GitHub instead of head-db.com.

The domain/page is basically discontinued, doesn't have https most of the time, serves the
JSON dump with the wrong Content-Type and its uptime has been an common issue in the past.
2023-04-06 10:38:20 +02:00
2 changed files with 3 additions and 2 deletions

1
docs/heads.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -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) {