diff options
| author | Tim Schiewe <git@tforge.de> | 2018-04-30 19:18:46 +0200 |
|---|---|---|
| committer | Tim Schiewe <git@tforge.de> | 2018-04-30 19:18:46 +0200 |
| commit | ac85779f3b67ffc2953c17d0824be62b1f0acc86 (patch) | |
| tree | 5442df8297c3620ed72af7e3ece2a77ad58cce35 /src/config.ts | |
| parent | 93b466df50d94d4c15715f5eb4d88a0be7d61c11 (diff) | |
| download | splus-ac85779f3b67ffc2953c17d0824be62b1f0acc86.tar.gz splus-ac85779f3b67ffc2953c17d0824be62b1f0acc86.zip | |
Implement interface/config based infrastructure
Fixes #2
Diffstat (limited to 'src/config.ts')
| -rw-r--r-- | src/config.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..47bcd02 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,29 @@ +import {ISource} from './sources/ISource'; +import {ISink} from './sinks/ISink'; +import {ILectureFilter} from './core/ILecture'; + +import {HttpSource} from './sources/HttpSource'; +import {IcalSink} from './sinks/IcalSink'; + +export interface SplusConfig { + source: ISource; + sink: ISink; + + lectureFilter?: ILectureFilter; +} + +export const config: SplusConfig = { + source: new HttpSource('http://splus.ostfalia.de/semesterplan123.php?id=1362F014835FFFD0F67159E302EC1A3C&identifier=%23SPLUS7A3292'), + sink: new IcalSink('out.ics'), + + lectureFilter: lecture => { + // Filter some lectures out + if (lecture.title === '') return false; + if (lecture.title.indexOf('Mathe-Cafe') !== -1) return false; + if (lecture.title.indexOf('Mathe-Repetitorium') !== -1) return false; + if (lecture.title.indexOf('Informatik-Lounge') !== -1) return false; + if (lecture.title.indexOf('Grundlagen des Programmierens') !== -1) return false; + if (lecture.title.indexOf('Reservierung') !== -1) return false; + return lecture.title.indexOf('Kompetenzen') === -1; + } +}; |
