diff options
author | yvesf <yvesf-git@xapek.org> | 2011-02-28 21:10:43 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2011-02-28 21:10:43 +0100 |
commit | f6347baf693c8246091dca498ee9349f4486d04f (patch) | |
tree | c4909d0dc193b1860e5189124bb619938207edd6 /src/main | |
parent | 70a30b84d932119c010693486c36a22860859697 (diff) | |
download | dhbw-calendar-f6347baf693c8246091dca498ee9349f4486d04f.tar.gz dhbw-calendar-f6347baf693c8246091dca498ee9349f4486d04f.zip |
Lade auch den folgenden Monat (closes gh-2)
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/dhbw/horb/calendar/dualis/DualisConnection.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/de/dhbw/horb/calendar/dualis/DualisConnection.java b/src/main/java/de/dhbw/horb/calendar/dualis/DualisConnection.java index 7d13c47..224bd82 100644 --- a/src/main/java/de/dhbw/horb/calendar/dualis/DualisConnection.java +++ b/src/main/java/de/dhbw/horb/calendar/dualis/DualisConnection.java @@ -103,12 +103,23 @@ public class DualisConnection { anchorMonat = page.getAnchorByText("Monat"); } catch (ElementNotFoundException e) { throw new DualisException.DualisScrapingException( - "Link Studenplan 'Woche' nicht gefunden", e); + "Link Studenplan 'Monat' nicht gefunden", e); } page = anchorMonat.click(); getEventsFromPage(page, events); + HtmlAnchor anchorNextMonth; + try { + anchorNextMonth = page.getAnchorByName("skipForward_btn"); + } catch (ElementNotFoundException e) { + throw new DualisException.DualisScrapingException( + "Link Studenplan 'Nächster Monat' nicht gefunden", e); + } + page = anchorNextMonth.click(); + + getEventsFromPage(page, events); + return events; } @@ -157,11 +168,13 @@ public class DualisConnection { cstart.setTimeZone(TimeZone.getTimeZone("Europe/Berlin")); cend.setTimeZone(TimeZone.getTimeZone("Europe/Berlin")); VEvent event = new VEvent.Builder().dtstart(cstart) - .dtstamp(cstart).dtend(cend).summary(title).description(title) - .location(room).status("CONFIRMED").build(); + .dtstamp(cstart).dtend(cend).summary(title) + .description(title).location(room) + .status("CONFIRMED").build(); events.add(event); } else { - System.err.println("Skip: " + desc + " at day " + cday.getTime()); + System.err.println("Skip: " + desc + " at day " + + cday.getTime()); } } } |