Last update timestamp

This commit is contained in:
2024-04-27 01:22:27 -04:00
parent bb72ebb5ab
commit 62c1d93e5a
2 changed files with 7 additions and 1 deletions

View File

@ -10,6 +10,8 @@ import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@ -18,6 +20,8 @@ import java.util.Set;
* @author Braydon
*/
public final class ReadMeManager {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM d yyyy");
/**
* Copy the template README.md file from the jar
* and update it with data from the given servers.
@ -36,6 +40,7 @@ public final class ReadMeManager {
// Replace variables in the README.md file
String contents = new String(Files.readAllBytes(localReadMe));
contents = contents.replace("<total-servers>", String.valueOf(servers.size())); // Total servers variable
contents = contents.replace("<last-updated>", DATE_FORMAT.format(new Date())); // Total servers variable
// Write the total servers per-region table
Map<String, Integer> regionCounts = new HashMap<>();

View File

@ -1,4 +1,5 @@
![Servers](https://img.shields.io/badge/servers-<total-servers>-darkgreen)
![Servers](https://img.shields.io/badge/Servers-<total-servers>-darkgreen)
![Last Updated](https://img.shields.io/badge/Last_Updated-<last-updated>-brightgreen)
# PIA-ServerList
An automatically updated list of IPs for PIA servers, this list is updated every hour, and servers in this list will be removed in they have not been seen in the last week.