From ccbaef8e5bf1badc1c3db2e2cddf4f6288850f00 Mon Sep 17 00:00:00 2001 From: Thastertyn Date: Wed, 29 Mar 2023 14:25:47 +0200 Subject: [PATCH] Omluvny list parser --- .../thastertyn/JecnaParse/OmluvnyList.java | 40 ++++++++++++++++++ .../thastertyn/JecnaParse/OmluvnyList.class | Bin 0 -> 2150 bytes 2 files changed, 40 insertions(+) create mode 100644 src/main/java/xyz/thastertyn/JecnaParse/OmluvnyList.java create mode 100644 target/classes/xyz/thastertyn/JecnaParse/OmluvnyList.class 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 0000000000000000000000000000000000000000..4bc779b3bd7a03c6639abad8a839e20f2d4d41d5 GIT binary patch literal 2150 zcmb_eYf~Fl7=8{3Sx6V50fZo}w)PUz!m6!`1knn#K*Oa%X~7FFo71qc>}Ga11^QF` z1Af&R8?2pi{NN{ll=V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