diff --git a/src/main/java/xyz/thastertyn/JecnaParse/OmluvnyList.java b/src/main/java/xyz/thastertyn/JecnaParse/OmluvnyList.java new file mode 100644 index 0000000..f79199e --- /dev/null +++ b/src/main/java/xyz/thastertyn/JecnaParse/OmluvnyList.java @@ -0,0 +1,40 @@ +package xyz.thastertyn.JecnaParse; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.ArrayList; + +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +import xyz.thastertyn.Tuple.Pair; + +public class OmluvnyList { + + private ArrayList> data = new ArrayList<>(); + + private boolean wasDownloaded = false; + + public void downloadOmluvnyList(final String JsessionId) throws UnknownHostException, IOException + { + Document doc = Downloader.download("https://www.spsejecna.cz/absence/student", JsessionId).get(); + + Elements omluv = doc.select("table.absence-list").select("tr"); + + for(Element e : omluv) + { + String date = e.child(0).text(); + String text = e.child(1).text(); + + data.add(new Pair(date, text)); + } + + wasDownloaded = true; + } + + public ArrayList> getData() + { + return data; + } +} diff --git a/target/classes/xyz/thastertyn/JecnaParse/OmluvnyList.class b/target/classes/xyz/thastertyn/JecnaParse/OmluvnyList.class new file mode 100644 index 0000000..4bc779b Binary files /dev/null and b/target/classes/xyz/thastertyn/JecnaParse/OmluvnyList.class differ