mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
23 lines
648 B
JavaScript
23 lines
648 B
JavaScript
|
|
class simpleCast {
|
||
|
|
constructor(data, url) {
|
||
|
|
this.title = data.title;
|
||
|
|
|
||
|
|
if (data['itunes:summary']) {
|
||
|
|
this.description = data['itunes:summary']['#'];
|
||
|
|
} else {
|
||
|
|
//<p>......<p>
|
||
|
|
this.description = data.description.substring(3, s.indexOf('<p>', 4));
|
||
|
|
}
|
||
|
|
|
||
|
|
var audio = data.enclosures.filter((entry) => { return (entry.type.indexOf('audio') != -1) });
|
||
|
|
if (audio.length > 0) {
|
||
|
|
this.audioLink = audio[0].url;
|
||
|
|
} else { console.log("What?"); }
|
||
|
|
this.url = url;
|
||
|
|
|
||
|
|
this.thumbnal = data.meta.image.url;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
module.exports = { simpleCast }
|