Skip to content

Commit

Permalink
Add channel Deutsche Welle Plus
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine Emrich committed Apr 2, 2017
1 parent bef0903 commit f82e0dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions downloader/dw-downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ const request = require('request');
const moment = require('moment-timezone');
const Show = require('../models/Show');

const url = 'http://www.dw.com/api/epg/5?languageId=1';
const urls = {
deutsche_welle: 'http://www.dw.com/api/epg/5?languageId=1&days=1',
deutsche_welle_plus: 'http://www.dw.com/api/epg/4?languageId=1&days=1'
};

exports.channelIds = ['deutsche_welle'];
exports.channelIds = Object.keys(urls);

function parseShow(showJson, channelId) {
let show = new Show(showJson.name);
Expand Down Expand Up @@ -40,6 +43,7 @@ function getShow(json, channelId) {
}

exports.getShow = function (channelId) {
let url = urls[channelId];
return new Promise((resolve, reject) => {
request.get({ url: url, json: true }, (err, res, data) => {
if (err) {
Expand Down

0 comments on commit f82e0dc

Please sign in to comment.