summaryrefslogtreecommitdiff
path: root/src/sources
diff options
context:
space:
mode:
Diffstat (limited to 'src/sources')
-rw-r--r--src/sources/FileSource.ts26
-rw-r--r--src/sources/HttpSource.ts23
-rw-r--r--src/sources/ISource.ts3
3 files changed, 0 insertions, 52 deletions
diff --git a/src/sources/FileSource.ts b/src/sources/FileSource.ts
deleted file mode 100644
index 57e51ae..0000000
--- a/src/sources/FileSource.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {readFile} from 'fs';
-
-import {ISource} from './ISource';
-
-export class FileSource implements ISource {
- private _path: string;
- private _data: string = null;
-
- constructor(course: string) {
- }
-
- getData(weekOfYear: number): Promise<string> {
- if (this._data) {
- return Promise.resolve(this._data);
- }
-
- return new Promise<string>((resolve, reject) => {
- readFile(this._path, (err, data) => {
- if (err) return reject(err);
-
- this._data = data.toString();
- resolve(this._data);
- });
- });
- }
-}
diff --git a/src/sources/HttpSource.ts b/src/sources/HttpSource.ts
deleted file mode 100644
index f9391aa..0000000
--- a/src/sources/HttpSource.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import * as request from 'request-promise-native';
-
-import {ISource} from './ISource';
-
-export class HttpSource implements ISource {
- private _base_uri = 'http://splus.ostfalia.de/semesterplan123.php';
-
- constructor(private _course: string) {
- }
-
- getData(weekOfYear: number): PromiseLike<string> {
- return request({
- method: 'POST',
- uri: this._base_uri,
- qs: {
- identifier: this._course,
- },
- formData: {
- weeks: weekOfYear.toString(),
- },
- });
- }
-}
diff --git a/src/sources/ISource.ts b/src/sources/ISource.ts
deleted file mode 100644
index 3605260..0000000
--- a/src/sources/ISource.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface ISource {
- getData(weekOfYear: number): PromiseLike<string>;
-}