timeeditapi
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -17,2 +17,7 @@ 'use strict'; | ||
/** | ||
* [gets types name and types value in array] | ||
* @param {[string]} url [timeedit url] | ||
* @return {[promise]} [array of object with all types] | ||
*/ | ||
static getAllTypes(url){ | ||
@@ -22,8 +27,5 @@ const t = new TimeEditCrawler(url); | ||
t.getHtml(t.getTypeUrl()) | ||
.then(html => resolve( | ||
dataParser.getTypes(html))) | ||
.then(html => resolve(dataParser.getTypes(html))) | ||
.catch(e => reject(e)); | ||
}); | ||
} | ||
@@ -39,9 +41,5 @@ | ||
super.getHtml(super.buildDataURL(id)) | ||
.then((html) => { | ||
return this._search(html); | ||
}).then((searchData) => { | ||
resolve(searchData); | ||
}).catch((er) => { | ||
reject(er); | ||
}); | ||
.then(html => this._search(html)) | ||
.then(searchData => resolve(searchData)) | ||
.catch(er => reject(er)); | ||
}); | ||
@@ -58,8 +56,6 @@ } | ||
this._getSchedule(id) | ||
.then((jsonString) => { | ||
.then(jsonString => { | ||
const parsedJson = JSON.parse(jsonString); | ||
resolve(dataParser.buildSchedule(parsedJson, id)); | ||
}).catch((er) => { | ||
reject(er); | ||
}); | ||
}).catch(er => reject(er)); | ||
}); | ||
@@ -76,8 +72,6 @@ } | ||
this._getSchedule(id) | ||
.then((jsonString) => { | ||
.then(jsonString => { | ||
const parsedJson = JSON.parse(jsonString); | ||
resolve(dataParser.buildTodaysSchedule(parsedJson, id)); | ||
}).catch((er) => { | ||
reject(er); | ||
}); | ||
}).catch(er => reject(er)); | ||
}); | ||
@@ -95,9 +89,5 @@ } | ||
super.getHtml(super.buildDataURL(id)) | ||
.then((html) => { | ||
return buildSchedule(this._search(html)); | ||
}).then((jsonString) => { | ||
resolve(jsonString); | ||
}).catch((er) => { | ||
reject(er); | ||
}); | ||
.then(html => buildSchedule(this._search(html))) | ||
.then(jsonString => resolve(jsonString)) | ||
.catch(er => reject(er)); | ||
}); | ||
@@ -104,0 +94,0 @@ } |
{ | ||
"name": "timeeditapi", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "api to easy get schedule information from timeedit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
9513
219